提交 f4e9749f 编写于 作者: J Julia Lawall 提交者: Takashi Iwai

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: NJulia Lawall <julia@diku.dk>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 42a6e66f
......@@ -446,7 +446,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
if (!card)
return -ENOMEM;
dev_set_drvdata(&intf->dev, card);
usb_set_intfdata(intf, card);
ret = init_card(caiaqdev(card));
if (ret < 0) {
log("unable to init card! (ret=%d)\n", ret);
......@@ -460,7 +460,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
static void snd_disconnect(struct usb_interface *intf)
{
struct snd_usb_caiaqdev *dev;
struct snd_card *card = dev_get_drvdata(&intf->dev);
struct snd_card *card = usb_get_intfdata(intf);
debug("%s(%p)\n", __func__, intf);
......
......@@ -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;
......
......@@ -589,7 +589,7 @@ static int snd_us122l_suspend(struct usb_interface *intf, pm_message_t message)
struct us122l *us122l;
struct list_head *p;
card = dev_get_drvdata(&intf->dev);
card = usb_get_intfdata(intf);
if (!card)
return 0;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
......@@ -615,7 +615,7 @@ static int snd_us122l_resume(struct usb_interface *intf)
struct list_head *p;
int err;
card = dev_get_drvdata(&intf->dev);
card = usb_get_intfdata(intf);
if (!card)
return 0;
......
......@@ -392,7 +392,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i
void *chip;
chip = usX2Y_usb_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;
......@@ -401,7 +401,7 @@ static int snd_usX2Y_probe(struct usb_interface *intf, const struct usb_device_i
static void snd_usX2Y_disconnect(struct usb_interface *intf)
{
usX2Y_usb_disconnect(interface_to_usbdev(intf),
dev_get_drvdata(&intf->dev));
usb_get_intfdata(intf));
}
MODULE_DEVICE_TABLE(usb, snd_usX2Y_usb_id_table);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册