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>
This commit is contained in:
@@ -95,7 +95,7 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n)
|
||||
struct snd_pcm *pcm;
|
||||
int error;
|
||||
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
error = snd_card_new(dev, index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
@@ -135,8 +135,6 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n)
|
||||
dev_warn(dev, "MPU401 not detected\n");
|
||||
}
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
error = snd_card_register(card);
|
||||
if (error < 0)
|
||||
goto out;
|
||||
|
@@ -364,13 +364,14 @@ static void snd_card_cs4236_free(struct snd_card *card)
|
||||
release_and_free_resource(acard->res_sb_port);
|
||||
}
|
||||
|
||||
static int snd_cs423x_card_new(int dev, struct snd_card **cardp)
|
||||
static int snd_cs423x_card_new(struct device *pdev, int dev,
|
||||
struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_cs4236), &card);
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_cs4236), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_card_cs4236_free;
|
||||
@@ -487,10 +488,9 @@ static int snd_cs423x_isa_probe(struct device *pdev,
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_cs423x_card_new(dev, &card);
|
||||
err = snd_cs423x_card_new(pdev, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
snd_card_set_dev(card, pdev);
|
||||
if ((err = snd_cs423x_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
@@ -577,7 +577,7 @@ static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
|
||||
if (!strcmp(cdev->id[0].id, cid))
|
||||
break;
|
||||
}
|
||||
err = snd_cs423x_card_new(dev, &card);
|
||||
err = snd_cs423x_card_new(&pdev->dev, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev);
|
||||
@@ -586,7 +586,6 @@ static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
snd_card_set_dev(card, &pdev->dev);
|
||||
if ((err = snd_cs423x_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
@@ -638,7 +637,7 @@ static int snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
res = snd_cs423x_card_new(dev, &card);
|
||||
res = snd_cs423x_card_new(&pcard->card->dev, dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) {
|
||||
@@ -647,7 +646,6 @@ static int snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
|
||||
snd_card_free(card);
|
||||
return res;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
if ((res = snd_cs423x_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user