From e735688875208fa2c0bec3be6692941e701c48a8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 29 Jan 2014 14:48:43 +0100 Subject: [media] Convert to snd_card_new() with a device pointer Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai --- drivers/media/usb/cx231xx/cx231xx-audio.c | 5 ++--- drivers/media/usb/em28xx/em28xx-audio.c | 5 ++--- drivers/media/usb/stk1160/stk1160-ac97.c | 6 ++---- drivers/media/usb/tlg2300/pd-alsa.c | 3 ++- drivers/media/usb/tm6000/tm6000-alsa.c | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) (limited to 'drivers/media/usb') diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c index 81a1d971d797..9b925874d392 100644 --- a/drivers/media/usb/cx231xx/cx231xx-audio.c +++ b/drivers/media/usb/cx231xx/cx231xx-audio.c @@ -665,8 +665,8 @@ static int cx231xx_audio_init(struct cx231xx *dev) cx231xx_info("cx231xx-audio.c: probing for cx231xx " "non standard usbaudio\n"); - err = snd_card_create(index[devnr], "Cx231xx Audio", THIS_MODULE, - 0, &card); + err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio", + THIS_MODULE, 0, &card); if (err < 0) return err; @@ -682,7 +682,6 @@ static int cx231xx_audio_init(struct cx231xx *dev) pcm->info_flags = 0; pcm->private_data = dev; strcpy(pcm->name, "Conexant cx231xx Capture"); - snd_card_set_dev(card, &dev->udev->dev); strcpy(card->driver, "Cx231xx-Audio"); strcpy(card->shortname, "Cx231xx Audio"); strcpy(card->longname, "Conexant cx231xx Audio"); diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 05e9bd11a3ff..1a28897af183 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -900,8 +900,8 @@ static int em28xx_audio_init(struct em28xx *dev) printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2007-2014 Mauro Carvalho Chehab\n"); - err = snd_card_create(index[devnr], "Em28xx Audio", THIS_MODULE, 0, - &card); + err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio", + THIS_MODULE, 0, &card); if (err < 0) return err; @@ -918,7 +918,6 @@ static int em28xx_audio_init(struct em28xx *dev) pcm->private_data = dev; strcpy(pcm->name, "Empia 28xx Capture"); - snd_card_set_dev(card, &dev->udev->dev); strcpy(card->driver, "Em28xx-Audio"); strcpy(card->shortname, "Em28xx Audio"); strcpy(card->longname, "Empia Em28xx Audio"); diff --git a/drivers/media/usb/stk1160/stk1160-ac97.c b/drivers/media/usb/stk1160/stk1160-ac97.c index c8583c262c3d..c46c8be89602 100644 --- a/drivers/media/usb/stk1160/stk1160-ac97.c +++ b/drivers/media/usb/stk1160/stk1160-ac97.c @@ -98,13 +98,11 @@ int stk1160_ac97_register(struct stk1160 *dev) * Just want a card to access ac96 controls, * the actual capture interface will be handled by snd-usb-audio */ - rc = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, - THIS_MODULE, 0, &card); + rc = snd_card_new(dev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, + THIS_MODULE, 0, &card); if (rc < 0) return rc; - snd_card_set_dev(card, dev->dev); - /* TODO: I'm not sure where should I get these names :-( */ snprintf(card->shortname, sizeof(card->shortname), "stk1160-mixer"); diff --git a/drivers/media/usb/tlg2300/pd-alsa.c b/drivers/media/usb/tlg2300/pd-alsa.c index 3f3e141f70fb..dd8fe100590f 100644 --- a/drivers/media/usb/tlg2300/pd-alsa.c +++ b/drivers/media/usb/tlg2300/pd-alsa.c @@ -300,7 +300,8 @@ int poseidon_audio_init(struct poseidon *p) struct snd_pcm *pcm; int ret; - ret = snd_card_create(-1, "Telegent", THIS_MODULE, 0, &card); + ret = snd_card_new(&p->interface->dev, -1, "Telegent", + THIS_MODULE, 0, &card); if (ret != 0) return ret; diff --git a/drivers/media/usb/tm6000/tm6000-alsa.c b/drivers/media/usb/tm6000/tm6000-alsa.c index 813c1ec53608..3239cd62e452 100644 --- a/drivers/media/usb/tm6000/tm6000-alsa.c +++ b/drivers/media/usb/tm6000/tm6000-alsa.c @@ -431,7 +431,8 @@ static int tm6000_audio_init(struct tm6000_core *dev) if (!enable[devnr]) return -ENOENT; - rc = snd_card_create(index[devnr], "tm6000", THIS_MODULE, 0, &card); + rc = snd_card_new(&dev->udev->dev, index[devnr], "tm6000", + THIS_MODULE, 0, &card); if (rc < 0) { snd_printk(KERN_ERR "cannot create card instance %d\n", devnr); return rc; @@ -445,7 +446,6 @@ static int tm6000_audio_init(struct tm6000_core *dev) le16_to_cpu(dev->udev->descriptor.idVendor), le16_to_cpu(dev->udev->descriptor.idProduct)); snd_component_add(card, component); - snd_card_set_dev(card, &dev->udev->dev); chip = kzalloc(sizeof(struct snd_tm6000_card), GFP_KERNEL); if (!chip) { -- cgit v1.2.3