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>
This commit is contained in:

committad av
Takashi Iwai

förälder
42a6e66f1e
incheckning
f4e9749f45
@@ -3709,7 +3709,7 @@ static int usb_audio_probe(struct usb_interface *intf,
|
||||
void *chip;
|
||||
chip = snd_usb_audio_probe(interface_to_usbdev(intf), intf, id);
|
||||
if (chip) {
|
||||
dev_set_drvdata(&intf->dev, chip);
|
||||
usb_set_intfdata(intf, chip);
|
||||
return 0;
|
||||
} else
|
||||
return -EIO;
|
||||
@@ -3718,13 +3718,13 @@ static int usb_audio_probe(struct usb_interface *intf,
|
||||
static void usb_audio_disconnect(struct usb_interface *intf)
|
||||
{
|
||||
snd_usb_audio_disconnect(interface_to_usbdev(intf),
|
||||
dev_get_drvdata(&intf->dev));
|
||||
usb_get_intfdata(intf));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
|
||||
{
|
||||
struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev);
|
||||
struct snd_usb_audio *chip = usb_get_intfdata(intf);
|
||||
struct list_head *p;
|
||||
struct snd_usb_stream *as;
|
||||
|
||||
@@ -3744,7 +3744,7 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
|
||||
|
||||
static int usb_audio_resume(struct usb_interface *intf)
|
||||
{
|
||||
struct snd_usb_audio *chip = dev_get_drvdata(&intf->dev);
|
||||
struct snd_usb_audio *chip = usb_get_intfdata(intf);
|
||||
|
||||
if (chip == (void *)-1L)
|
||||
return 0;
|
||||
|
Referens i nytt ärende
Block a user