diff options
author | Julia Lawall <julia@diku.dk> | 2009-01-01 12:14:35 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-01-02 05:52:45 -0500 |
commit | f4e9749f451747f7cdd334eae951357f839c57f2 (patch) | |
tree | 8aa29510c2de7a5326cf1c21d8e1588598b024cc /sound/usb | |
parent | 42a6e66f1e40a930d093c33ba0bb9d8d8e4555ed (diff) |
ALSA: Use usb_set/get_intfdata
Use the USB functions usb_get_intfdata and usb_set_intfdata instead of
dev_get_drvdata and dev_set_drvdata, respectively.
The semantic patch that makes this change for the usb_get_intfdata case is
as follows: (http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@header@
@@
#include <linux/usb.h>
@same depends on header@
position p;
@@
usb_get_intfdata@p(...) { ... }
@depends on header@
position _p!=same.p;
identifier _f;
struct usb_interface*intf;
@@
_f@_p(...) { <+...
- dev_get_drvdata(&intf->dev)
+ usb_get_intfdata(intf)
...+> }
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/caiaq/caiaq-device.c | 4 | ||||
-rw-r--r-- | sound/usb/usbaudio.c | 8 | ||||
-rw-r--r-- | sound/usb/usx2y/us122l.c | 4 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index b143ef7152f7..a62500e387a6 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c | |||
@@ -446,7 +446,7 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
446 | if (!card) | 446 | if (!card) |
447 | return -ENOMEM; | 447 | return -ENOMEM; |
448 | 448 | ||
449 | dev_set_drvdata(&intf->dev, card); | 449 | usb_set_intfdata(intf, card); |
450 | ret = init_card(caiaqdev(card)); | 450 | ret = init_card(caiaqdev(card)); |
451 | if (ret < 0) { | 451 | if (ret < 0) { |
452 | log("unable to init card! (ret=%d)\n", ret); | 452 | log("unable to init card! (ret=%d)\n", ret); |
@@ -460,7 +460,7 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
460 | static void snd_disconnect(struct usb_interface *intf) | 460 | static void snd_disconnect(struct usb_interface *intf) |
461 | { | 461 | { |
462 | struct snd_usb_caiaqdev *dev; | 462 | struct snd_usb_caiaqdev *dev; |
463 | struct snd_card *card = dev_get_drvdata(&intf->dev); | 463 | struct snd_card *card = usb_get_intfdata(intf); |
464 | 464 | ||
465 | debug("%s(%p)\n", __func__, intf); | 465 | debug("%s(%p)\n", __func__, intf); |
466 | 466 | ||
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index bbd70d5814a0..c709b9563226 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -3709,7 +3709,7 @@ static int usb_audio_probe(struct usb_interface *intf, | |||
3709 | void *chip; | 3709 | void *chip; |
3710 | chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); | 3710 | chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id); |
3711 | if (chip) { | 3711 | if (chip) { |
3712 | dev_set_drvdata(&intf->dev, chip); | 3712 | usb_set_intfdata(intf, chip); |
3713 | return 0; | 3713 | return 0; |
3714 | } else | 3714 | } else |
3715 | return -EIO; | 3715 | return -EIO; |
@@ -3718,13 +3718,13 @@ static int usb_audio_probe(struct usb_interface *intf, | |||
3718 | static void usb_audio_disconnect(struct usb_interface *intf) | 3718 | static void usb_audio_disconnect(struct usb_interface *intf) |
3719 | { | 3719 | { |
3720 | snd_usb_audio_disconnect(interface_to_usbdev(intf), | 3720 | snd_usb_audio_disconnect(interface_to_usbdev(intf), |
3721 | dev_get_drvdata(&intf->dev)); | 3721 | usb_get_intfdata(intf)); |
3722 | } | 3722 | } |
3723 | 3723 | ||
3724 | #ifdef CONFIG_PM | 3724 | #ifdef CONFIG_PM |
3725 | static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | 3725 | static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) |
3726 | { | 3726 | { |
3727 | struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); | 3727 | struct snd_usb_audio *chip = usb_get_intfdata(intf); |
3728 | struct list_head *p; | 3728 | struct list_head *p; |
3729 | struct snd_usb_stream *as; | 3729 | struct snd_usb_stream *as; |
3730 | 3730 | ||
@@ -3744,7 +3744,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | |||
3744 | 3744 | ||
3745 | static int usb_audio_resume(struct usb_interface *intf) | 3745 | static int usb_audio_resume(struct usb_interface *intf) |
3746 | { | 3746 | { |
3747 | struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev); | 3747 | struct snd_usb_audio *chip = usb_get_intfdata(intf); |
3748 | 3748 | ||
3749 | if (chip == (void *)-1L) | 3749 | if (chip == (void *)-1L) |
3750 | return 0; | 3750 | return 0; |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index c2515b680f9f..73e59f4403a4 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -589,7 +589,7 @@ static int snd_us122l_suspend(struct usb_interface *intf, pm_message_t message) | |||
589 | struct us122l *us122l; | 589 | struct us122l *us122l; |
590 | struct list_head *p; | 590 | struct list_head *p; |
591 | 591 | ||
592 | card = dev_get_drvdata(&intf->dev); | 592 | card = usb_get_intfdata(intf); |
593 | if (!card) | 593 | if (!card) |
594 | return 0; | 594 | return 0; |
595 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | 595 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
@@ -615,7 +615,7 @@ static int snd_us122l_resume(struct usb_interface *intf) | |||
615 | struct list_head *p; | 615 | struct list_head *p; |
616 | int err; | 616 | int err; |
617 | 617 | ||
618 | card = dev_get_drvdata(&intf->dev); | 618 | card = usb_get_intfdata(intf); |
619 | if (!card) | 619 | if (!card) |
620 | return 0; | 620 | return 0; |
621 | 621 | ||
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index e5981a630314..ca26c532e77e 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -392,7 +392,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i | |||
392 | void *chip; | 392 | void *chip; |
393 | chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); | 393 | chip = usX2Y_usb_probe(interface_to_usbdev(intf), intf, id); |
394 | if (chip) { | 394 | if (chip) { |
395 | dev_set_drvdata(&intf->dev, chip); | 395 | usb_set_intfdata(intf, chip); |
396 | return 0; | 396 | return 0; |
397 | } else | 397 | } else |
398 | return -EIO; | 398 | return -EIO; |
@@ -401,7 +401,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i | |||
401 | static void snd_usX2Y_disconnect(struct usb_interface *intf) | 401 | static void snd_usX2Y_disconnect(struct usb_interface *intf) |
402 | { | 402 | { |
403 | usX2Y_usb_disconnect(interface_to_usbdev(intf), | 403 | usX2Y_usb_disconnect(interface_to_usbdev(intf), |
404 | dev_get_drvdata(&intf->dev)); | 404 | usb_get_intfdata(intf)); |
405 | } | 405 | } |
406 | 406 | ||
407 | MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); | 407 | MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table); |