aboutsummaryrefslogtreecommitdiffstats
path: root/sound/atmel
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-01-29 08:26:22 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-14 02:14:04 -0500
commita4f2473d39eb72915d37d65bdd8dd734c7ee4f8a (patch)
tree7cfdfdff50222ca2526749742869cf2b1b48ab8f /sound/atmel
parent4a87558018ca095795c937ce6f266699c5ec35ff (diff)
ALSA: atmel: 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>
Diffstat (limited to 'sound/atmel')
-rw-r--r--sound/atmel/abdac.c13
-rw-r--r--sound/atmel/ac97c.c10
2 files changed, 7 insertions, 16 deletions
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index 3519518e25a0..edf2ca72d518 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -429,8 +429,9 @@ static int atmel_abdac_probe(struct platform_device *pdev)
429 } 429 }
430 clk_enable(pclk); 430 clk_enable(pclk);
431 431
432 retval = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, 432 retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
433 THIS_MODULE, sizeof(struct atmel_abdac), &card); 433 SNDRV_DEFAULT_STR1, THIS_MODULE,
434 sizeof(struct atmel_abdac), &card);
434 if (retval) { 435 if (retval) {
435 dev_dbg(&pdev->dev, "could not create sound card device\n"); 436 dev_dbg(&pdev->dev, "could not create sound card device\n");
436 goto out_put_sample_clk; 437 goto out_put_sample_clk;
@@ -467,8 +468,6 @@ static int atmel_abdac_probe(struct platform_device *pdev)
467 goto out_unmap_regs; 468 goto out_unmap_regs;
468 } 469 }
469 470
470 snd_card_set_dev(card, &pdev->dev);
471
472 if (pdata->dws.dma_dev) { 471 if (pdata->dws.dma_dev) {
473 dma_cap_mask_t mask; 472 dma_cap_mask_t mask;
474 473
@@ -492,7 +491,7 @@ static int atmel_abdac_probe(struct platform_device *pdev)
492 if (!pdata->dws.dma_dev || !dac->dma.chan) { 491 if (!pdata->dws.dma_dev || !dac->dma.chan) {
493 dev_dbg(&pdev->dev, "DMA not available\n"); 492 dev_dbg(&pdev->dev, "DMA not available\n");
494 retval = -ENODEV; 493 retval = -ENODEV;
495 goto out_unset_card_dev; 494 goto out_unmap_regs;
496 } 495 }
497 496
498 strcpy(card->driver, "Atmel ABDAC"); 497 strcpy(card->driver, "Atmel ABDAC");
@@ -521,9 +520,6 @@ static int atmel_abdac_probe(struct platform_device *pdev)
521out_release_dma: 520out_release_dma:
522 dma_release_channel(dac->dma.chan); 521 dma_release_channel(dac->dma.chan);
523 dac->dma.chan = NULL; 522 dac->dma.chan = NULL;
524out_unset_card_dev:
525 snd_card_set_dev(card, NULL);
526 free_irq(irq, dac);
527out_unmap_regs: 523out_unmap_regs:
528 iounmap(dac->regs); 524 iounmap(dac->regs);
529out_free_card: 525out_free_card:
@@ -579,7 +575,6 @@ static int atmel_abdac_remove(struct platform_device *pdev)
579 575
580 dma_release_channel(dac->dma.chan); 576 dma_release_channel(dac->dma.chan);
581 dac->dma.chan = NULL; 577 dac->dma.chan = NULL;
582 snd_card_set_dev(card, NULL);
583 iounmap(dac->regs); 578 iounmap(dac->regs);
584 free_irq(dac->irq, dac); 579 free_irq(dac->irq, dac);
585 snd_card_free(card); 580 snd_card_free(card);
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index c5f0ddd729b3..05ec049c9faf 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -945,8 +945,9 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
945 } 945 }
946 clk_enable(pclk); 946 clk_enable(pclk);
947 947
948 retval = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, 948 retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
949 THIS_MODULE, sizeof(struct atmel_ac97c), &card); 949 SNDRV_DEFAULT_STR1, THIS_MODULE,
950 sizeof(struct atmel_ac97c), &card);
950 if (retval) { 951 if (retval) {
951 dev_dbg(&pdev->dev, "could not create sound card device\n"); 952 dev_dbg(&pdev->dev, "could not create sound card device\n");
952 goto err_snd_card_new; 953 goto err_snd_card_new;
@@ -990,8 +991,6 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
990 chip->reset_pin = -EINVAL; 991 chip->reset_pin = -EINVAL;
991 } 992 }
992 993
993 snd_card_set_dev(card, &pdev->dev);
994
995 atmel_ac97c_reset(chip); 994 atmel_ac97c_reset(chip);
996 995
997 /* Enable overrun interrupt from codec channel */ 996 /* Enable overrun interrupt from codec channel */
@@ -1113,8 +1112,6 @@ err_dma:
1113 chip->dma.tx_chan = NULL; 1112 chip->dma.tx_chan = NULL;
1114 } 1113 }
1115err_ac97_bus: 1114err_ac97_bus:
1116 snd_card_set_dev(card, NULL);
1117
1118 if (gpio_is_valid(chip->reset_pin)) 1115 if (gpio_is_valid(chip->reset_pin))
1119 gpio_free(chip->reset_pin); 1116 gpio_free(chip->reset_pin);
1120 1117
@@ -1195,7 +1192,6 @@ static int atmel_ac97c_remove(struct platform_device *pdev)
1195 chip->dma.tx_chan = NULL; 1192 chip->dma.tx_chan = NULL;
1196 } 1193 }
1197 1194
1198 snd_card_set_dev(card, NULL);
1199 snd_card_free(card); 1195 snd_card_free(card);
1200 1196
1201 return 0; 1197 return 0;