diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-29 16:03:56 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-12 13:58:21 +0400 |
commit | 4323cc4d5b25b5138c0791e3c7d3b09bd7062b49 (patch) | |
tree | 864a8549eae025d2108cefbb19bc61e18a9bc659 /sound/isa/opl3sa2.c | |
parent | 5872f3f621f9f65342583a85ec93b00c0a697eda (diff) | |
download | linux-4323cc4d5b25b5138c0791e3c7d3b09bd7062b49.tar.xz |
ALSA: isa: 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/isa/opl3sa2.c')
-rw-r--r-- | sound/isa/opl3sa2.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index cc01c419b7e9..a219bc37816b 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -627,14 +627,15 @@ static void snd_opl3sa2_free(struct snd_card *card) release_and_free_resource(chip->res_port); } -static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp) +static int snd_opl3sa2_card_new(struct device *pdev, int dev, + struct snd_card **cardp) { struct snd_card *card; struct snd_opl3sa2 *chip; int err; - err = snd_card_create(index[dev], id[dev], THIS_MODULE, - sizeof(struct snd_opl3sa2), &card); + err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE, + sizeof(struct snd_opl3sa2), &card); if (err < 0) return err; strcpy(card->driver, "OPL3SA2"); @@ -737,14 +738,13 @@ static int snd_opl3sa2_pnp_detect(struct pnp_dev *pdev, if (dev >= SNDRV_CARDS) return -ENODEV; - err = snd_opl3sa2_card_new(dev, &card); + err = snd_opl3sa2_card_new(&pdev->dev, dev, &card); if (err < 0) return err; if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { snd_card_free(card); return err; } - snd_card_set_dev(card, &pdev->dev); if ((err = snd_opl3sa2_probe(card, dev)) < 0) { snd_card_free(card); return err; @@ -802,14 +802,13 @@ static int snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, if (dev >= SNDRV_CARDS) return -ENODEV; - err = snd_opl3sa2_card_new(dev, &card); + err = snd_opl3sa2_card_new(&pdev->dev, dev, &card); if (err < 0) return err; if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { snd_card_free(card); return err; } - snd_card_set_dev(card, &pdev->dev); if ((err = snd_opl3sa2_probe(card, dev)) < 0) { snd_card_free(card); return err; @@ -883,10 +882,9 @@ static int snd_opl3sa2_isa_probe(struct device *pdev, struct snd_card *card; int err; - err = snd_opl3sa2_card_new(dev, &card); + err = snd_opl3sa2_card_new(pdev, dev, &card); if (err < 0) return err; - snd_card_set_dev(card, pdev); if ((err = snd_opl3sa2_probe(card, dev)) < 0) { snd_card_free(card); return err; |