Skip to content

Commit

Permalink
ALSA: arm: Convert to snd_card_new() with a device pointer
Browse files Browse the repository at this point in the history
Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
tiwai committed Feb 14, 2014
1 parent 06b45f0 commit 4a87558
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions sound/arm/aaci.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,8 @@ static struct aaci *aaci_init_card(struct amba_device *dev)
struct snd_card *card;
int err;

err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, sizeof(struct aaci), &card);
err = snd_card_new(&dev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, sizeof(struct aaci), &card);
if (err < 0)
return NULL;

Expand Down Expand Up @@ -1055,8 +1055,6 @@ static int aaci_probe(struct amba_device *dev,
if (ret)
goto out;

snd_card_set_dev(aaci->card, &dev->dev);

ret = snd_card_register(aaci->card);
if (ret == 0) {
dev_info(&dev->dev, "%s\n", aaci->card->longname);
Expand Down
6 changes: 2 additions & 4 deletions sound/arm/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,11 @@ static int pxa2xx_ac97_probe(struct platform_device *dev)
goto err_dev;
}

ret = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, 0, &card);
ret = snd_card_new(&dev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, 0, &card);
if (ret < 0)
goto err;

card->dev = &dev->dev;
strlcpy(card->driver, dev->dev.driver->name, sizeof(card->driver));

ret = pxa2xx_pcm_new(card, &pxa2xx_ac97_pcm_client, &pxa2xx_ac97_pcm);
Expand All @@ -210,7 +209,6 @@ static int pxa2xx_ac97_probe(struct platform_device *dev)

if (pdata && pdata->codec_pdata[0])
snd_ac97_dev_add_pdata(ac97_bus->codec[0], pdata->codec_pdata[0]);
snd_card_set_dev(card, &dev->dev);
ret = snd_card_register(card);
if (ret == 0) {
platform_set_drvdata(dev, card);
Expand Down

0 comments on commit 4a87558

Please sign in to comment.