diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-29 08:48:43 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-14 02:14:09 -0500 |
commit | e735688875208fa2c0bec3be6692941e701c48a8 (patch) | |
tree | 4e24136a49d244a62e4e4faddd1f62e910e6d2ef | |
parent | b9d4e7b0f612ecf6a0a29a046efc4828703f63c4 (diff) |
[media] Convert to snd_card_new() with a device pointer
Also remove superfluous snd_card_set_dev() calls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | drivers/media/pci/cx18/cx18-alsa-main.c | 9 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-alsa.c | 5 | ||||
-rw-r--r-- | drivers/media/pci/cx25821/cx25821-alsa.c | 7 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-alsa.c | 6 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-alsa-main.c | 9 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-alsa.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-audio.c | 5 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-audio.c | 5 | ||||
-rw-r--r-- | drivers/media/usb/stk1160/stk1160-ac97.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/tlg2300/pd-alsa.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-alsa.c | 4 |
11 files changed, 29 insertions, 36 deletions
diff --git a/drivers/media/pci/cx18/cx18-alsa-main.c b/drivers/media/pci/cx18/cx18-alsa-main.c index b2c8c3439fea..ea272bcb38df 100644 --- a/drivers/media/pci/cx18/cx18-alsa-main.c +++ b/drivers/media/pci/cx18/cx18-alsa-main.c | |||
@@ -145,11 +145,12 @@ static int snd_cx18_init(struct v4l2_device *v4l2_dev) | |||
145 | /* This is a no-op for us. We'll use the cx->instance */ | 145 | /* This is a no-op for us. We'll use the cx->instance */ |
146 | 146 | ||
147 | /* (2) Create a card instance */ | 147 | /* (2) Create a card instance */ |
148 | ret = snd_card_create(SNDRV_DEFAULT_IDX1, /* use first available id */ | 148 | ret = snd_card_new(&cx->pci_dev->dev, |
149 | SNDRV_DEFAULT_STR1, /* xid from end of shortname*/ | 149 | SNDRV_DEFAULT_IDX1, /* use first available id */ |
150 | THIS_MODULE, 0, &sc); | 150 | SNDRV_DEFAULT_STR1, /* xid from end of shortname*/ |
151 | THIS_MODULE, 0, &sc); | ||
151 | if (ret) { | 152 | if (ret) { |
152 | CX18_ALSA_ERR("%s: snd_card_create() failed with err %d\n", | 153 | CX18_ALSA_ERR("%s: snd_card_new() failed with err %d\n", |
153 | __func__, ret); | 154 | __func__, ret); |
154 | goto err_exit; | 155 | goto err_exit; |
155 | } | 156 | } |
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c index c6c9bd58f8be..554798dcedd0 100644 --- a/drivers/media/pci/cx23885/cx23885-alsa.c +++ b/drivers/media/pci/cx23885/cx23885-alsa.c | |||
@@ -489,7 +489,8 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev) | |||
489 | return NULL; | 489 | return NULL; |
490 | } | 490 | } |
491 | 491 | ||
492 | err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, | 492 | err = snd_card_new(&dev->pci->dev, |
493 | SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, | ||
493 | THIS_MODULE, sizeof(struct cx23885_audio_dev), &card); | 494 | THIS_MODULE, sizeof(struct cx23885_audio_dev), &card); |
494 | if (err < 0) | 495 | if (err < 0) |
495 | goto error; | 496 | goto error; |
@@ -500,8 +501,6 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev) | |||
500 | chip->card = card; | 501 | chip->card = card; |
501 | spin_lock_init(&chip->lock); | 502 | spin_lock_init(&chip->lock); |
502 | 503 | ||
503 | snd_card_set_dev(card, &dev->pci->dev); | ||
504 | |||
505 | err = snd_cx23885_pcm(chip, 0, "CX23885 Digital"); | 504 | err = snd_cx23885_pcm(chip, 0, "CX23885 Digital"); |
506 | if (err < 0) | 505 | if (err < 0) |
507 | goto error; | 506 | goto error; |
diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c index b1e08c3e55cd..2dd5bcaa7e53 100644 --- a/drivers/media/pci/cx25821/cx25821-alsa.c +++ b/drivers/media/pci/cx25821/cx25821-alsa.c | |||
@@ -645,8 +645,9 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev) | |||
645 | return -ENOENT; | 645 | return -ENOENT; |
646 | } | 646 | } |
647 | 647 | ||
648 | err = snd_card_create(index[devno], id[devno], THIS_MODULE, | 648 | err = snd_card_new(&dev->pci->dev, index[devno], id[devno], |
649 | sizeof(struct cx25821_audio_dev), &card); | 649 | THIS_MODULE, |
650 | sizeof(struct cx25821_audio_dev), &card); | ||
650 | if (err < 0) { | 651 | if (err < 0) { |
651 | pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n", | 652 | pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n", |
652 | __func__); | 653 | __func__); |
@@ -682,8 +683,6 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev) | |||
682 | goto error; | 683 | goto error; |
683 | } | 684 | } |
684 | 685 | ||
685 | snd_card_set_dev(card, &chip->pci->dev); | ||
686 | |||
687 | strcpy(card->shortname, "cx25821"); | 686 | strcpy(card->shortname, "cx25821"); |
688 | sprintf(card->longname, "%s at 0x%lx irq %d", chip->dev->name, | 687 | sprintf(card->longname, "%s at 0x%lx irq %d", chip->dev->name, |
689 | chip->iobase, chip->irq); | 688 | chip->iobase, chip->irq); |
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index d014206e7176..a72579a9f67f 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c | |||
@@ -852,8 +852,6 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci, | |||
852 | chip->irq = pci->irq; | 852 | chip->irq = pci->irq; |
853 | synchronize_irq(chip->irq); | 853 | synchronize_irq(chip->irq); |
854 | 854 | ||
855 | snd_card_set_dev(card, &pci->dev); | ||
856 | |||
857 | *rchip = chip; | 855 | *rchip = chip; |
858 | *core_ptr = core; | 856 | *core_ptr = core; |
859 | 857 | ||
@@ -876,8 +874,8 @@ static int cx88_audio_initdev(struct pci_dev *pci, | |||
876 | return (-ENOENT); | 874 | return (-ENOENT); |
877 | } | 875 | } |
878 | 876 | ||
879 | err = snd_card_create(index[devno], id[devno], THIS_MODULE, | 877 | err = snd_card_new(&pci->dev, index[devno], id[devno], THIS_MODULE, |
880 | sizeof(snd_cx88_card_t), &card); | 878 | sizeof(snd_cx88_card_t), &card); |
881 | if (err < 0) | 879 | if (err < 0) |
882 | return err; | 880 | return err; |
883 | 881 | ||
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-main.c b/drivers/media/pci/ivtv/ivtv-alsa-main.c index e970cface70e..39b52929755a 100644 --- a/drivers/media/pci/ivtv/ivtv-alsa-main.c +++ b/drivers/media/pci/ivtv/ivtv-alsa-main.c | |||
@@ -145,11 +145,12 @@ static int snd_ivtv_init(struct v4l2_device *v4l2_dev) | |||
145 | /* This is a no-op for us. We'll use the itv->instance */ | 145 | /* This is a no-op for us. We'll use the itv->instance */ |
146 | 146 | ||
147 | /* (2) Create a card instance */ | 147 | /* (2) Create a card instance */ |
148 | ret = snd_card_create(SNDRV_DEFAULT_IDX1, /* use first available id */ | 148 | ret = snd_card_new(&itv->pdev->dev, |
149 | SNDRV_DEFAULT_STR1, /* xid from end of shortname*/ | 149 | SNDRV_DEFAULT_IDX1, /* use first available id */ |
150 | THIS_MODULE, 0, &sc); | 150 | SNDRV_DEFAULT_STR1, /* xid from end of shortname*/ |
151 | THIS_MODULE, 0, &sc); | ||
151 | if (ret) { | 152 | if (ret) { |
152 | IVTV_ALSA_ERR("%s: snd_card_create() failed with err %d\n", | 153 | IVTV_ALSA_ERR("%s: snd_card_new() failed with err %d\n", |
153 | __func__, ret); | 154 | __func__, ret); |
154 | goto err_exit; | 155 | goto err_exit; |
155 | } | 156 | } |
diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c index dd67c8a400cc..e04a4d5d6672 100644 --- a/drivers/media/pci/saa7134/saa7134-alsa.c +++ b/drivers/media/pci/saa7134/saa7134-alsa.c | |||
@@ -1072,8 +1072,8 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) | |||
1072 | if (!enable[devnum]) | 1072 | if (!enable[devnum]) |
1073 | return -ENODEV; | 1073 | return -ENODEV; |
1074 | 1074 | ||
1075 | err = snd_card_create(index[devnum], id[devnum], THIS_MODULE, | 1075 | err = snd_card_new(&dev->pci->dev, index[devnum], id[devnum], |
1076 | sizeof(snd_card_saa7134_t), &card); | 1076 | THIS_MODULE, sizeof(snd_card_saa7134_t), &card); |
1077 | if (err < 0) | 1077 | if (err < 0) |
1078 | return err; | 1078 | return err; |
1079 | 1079 | ||
@@ -1115,8 +1115,6 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) | |||
1115 | if ((err = snd_card_saa7134_pcm(chip, 0)) < 0) | 1115 | if ((err = snd_card_saa7134_pcm(chip, 0)) < 0) |
1116 | goto __nodev; | 1116 | goto __nodev; |
1117 | 1117 | ||
1118 | snd_card_set_dev(card, &chip->pci->dev); | ||
1119 | |||
1120 | /* End of "creation" */ | 1118 | /* End of "creation" */ |
1121 | 1119 | ||
1122 | strcpy(card->shortname, "SAA7134"); | 1120 | strcpy(card->shortname, "SAA7134"); |
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) | |||
665 | cx231xx_info("cx231xx-audio.c: probing for cx231xx " | 665 | cx231xx_info("cx231xx-audio.c: probing for cx231xx " |
666 | "non standard usbaudio\n"); | 666 | "non standard usbaudio\n"); |
667 | 667 | ||
668 | err = snd_card_create(index[devnr], "Cx231xx Audio", THIS_MODULE, | 668 | err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio", |
669 | 0, &card); | 669 | THIS_MODULE, 0, &card); |
670 | if (err < 0) | 670 | if (err < 0) |
671 | return err; | 671 | return err; |
672 | 672 | ||
@@ -682,7 +682,6 @@ static int cx231xx_audio_init(struct cx231xx *dev) | |||
682 | pcm->info_flags = 0; | 682 | pcm->info_flags = 0; |
683 | pcm->private_data = dev; | 683 | pcm->private_data = dev; |
684 | strcpy(pcm->name, "Conexant cx231xx Capture"); | 684 | strcpy(pcm->name, "Conexant cx231xx Capture"); |
685 | snd_card_set_dev(card, &dev->udev->dev); | ||
686 | strcpy(card->driver, "Cx231xx-Audio"); | 685 | strcpy(card->driver, "Cx231xx-Audio"); |
687 | strcpy(card->shortname, "Cx231xx Audio"); | 686 | strcpy(card->shortname, "Cx231xx Audio"); |
688 | strcpy(card->longname, "Conexant cx231xx Audio"); | 687 | 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) | |||
900 | printk(KERN_INFO | 900 | printk(KERN_INFO |
901 | "em28xx-audio.c: Copyright (C) 2007-2014 Mauro Carvalho Chehab\n"); | 901 | "em28xx-audio.c: Copyright (C) 2007-2014 Mauro Carvalho Chehab\n"); |
902 | 902 | ||
903 | err = snd_card_create(index[devnr], "Em28xx Audio", THIS_MODULE, 0, | 903 | err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio", |
904 | &card); | 904 | THIS_MODULE, 0, &card); |
905 | if (err < 0) | 905 | if (err < 0) |
906 | return err; | 906 | return err; |
907 | 907 | ||
@@ -918,7 +918,6 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
918 | pcm->private_data = dev; | 918 | pcm->private_data = dev; |
919 | strcpy(pcm->name, "Empia 28xx Capture"); | 919 | strcpy(pcm->name, "Empia 28xx Capture"); |
920 | 920 | ||
921 | snd_card_set_dev(card, &dev->udev->dev); | ||
922 | strcpy(card->driver, "Em28xx-Audio"); | 921 | strcpy(card->driver, "Em28xx-Audio"); |
923 | strcpy(card->shortname, "Em28xx Audio"); | 922 | strcpy(card->shortname, "Em28xx Audio"); |
924 | strcpy(card->longname, "Empia Em28xx Audio"); | 923 | 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) | |||
98 | * Just want a card to access ac96 controls, | 98 | * Just want a card to access ac96 controls, |
99 | * the actual capture interface will be handled by snd-usb-audio | 99 | * the actual capture interface will be handled by snd-usb-audio |
100 | */ | 100 | */ |
101 | rc = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, | 101 | rc = snd_card_new(dev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, |
102 | THIS_MODULE, 0, &card); | 102 | THIS_MODULE, 0, &card); |
103 | if (rc < 0) | 103 | if (rc < 0) |
104 | return rc; | 104 | return rc; |
105 | 105 | ||
106 | snd_card_set_dev(card, dev->dev); | ||
107 | |||
108 | /* TODO: I'm not sure where should I get these names :-( */ | 106 | /* TODO: I'm not sure where should I get these names :-( */ |
109 | snprintf(card->shortname, sizeof(card->shortname), | 107 | snprintf(card->shortname, sizeof(card->shortname), |
110 | "stk1160-mixer"); | 108 | "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) | |||
300 | struct snd_pcm *pcm; | 300 | struct snd_pcm *pcm; |
301 | int ret; | 301 | int ret; |
302 | 302 | ||
303 | ret = snd_card_create(-1, "Telegent", THIS_MODULE, 0, &card); | 303 | ret = snd_card_new(&p->interface->dev, -1, "Telegent", |
304 | THIS_MODULE, 0, &card); | ||
304 | if (ret != 0) | 305 | if (ret != 0) |
305 | return ret; | 306 | return ret; |
306 | 307 | ||
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) | |||
431 | if (!enable[devnr]) | 431 | if (!enable[devnr]) |
432 | return -ENOENT; | 432 | return -ENOENT; |
433 | 433 | ||
434 | rc = snd_card_create(index[devnr], "tm6000", THIS_MODULE, 0, &card); | 434 | rc = snd_card_new(&dev->udev->dev, index[devnr], "tm6000", |
435 | THIS_MODULE, 0, &card); | ||
435 | if (rc < 0) { | 436 | if (rc < 0) { |
436 | snd_printk(KERN_ERR "cannot create card instance %d\n", devnr); | 437 | snd_printk(KERN_ERR "cannot create card instance %d\n", devnr); |
437 | return rc; | 438 | return rc; |
@@ -445,7 +446,6 @@ static int tm6000_audio_init(struct tm6000_core *dev) | |||
445 | le16_to_cpu(dev->udev->descriptor.idVendor), | 446 | le16_to_cpu(dev->udev->descriptor.idVendor), |
446 | le16_to_cpu(dev->udev->descriptor.idProduct)); | 447 | le16_to_cpu(dev->udev->descriptor.idProduct)); |
447 | snd_component_add(card, component); | 448 | snd_component_add(card, component); |
448 | snd_card_set_dev(card, &dev->udev->dev); | ||
449 | 449 | ||
450 | chip = kzalloc(sizeof(struct snd_tm6000_card), GFP_KERNEL); | 450 | chip = kzalloc(sizeof(struct snd_tm6000_card), GFP_KERNEL); |
451 | if (!chip) { | 451 | if (!chip) { |