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:
Родитель
5872f3f621
Коммит
4323cc4d5b
|
@ -144,7 +144,8 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
|
|||
struct snd_opl3 *opl3;
|
||||
struct snd_timer *timer;
|
||||
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
error = snd_card_new(&pcard->card->dev,
|
||||
index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_ad1816a), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -154,7 +155,6 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
|
|||
snd_card_free(card);
|
||||
return error;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
||||
if ((error = snd_ad1816a_create(card, port[dev],
|
||||
irq[dev],
|
||||
|
|
|
@ -91,7 +91,7 @@ static int snd_ad1848_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;
|
||||
|
||||
|
@ -119,8 +119,6 @@ static int snd_ad1848_probe(struct device *dev, unsigned int n)
|
|||
if (thinkpad[n])
|
||||
strcat(card->longname, " [Thinkpad]");
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
error = snd_card_register(card);
|
||||
if (error < 0)
|
||||
goto out;
|
||||
|
|
|
@ -53,7 +53,7 @@ static int snd_adlib_probe(struct device *dev, unsigned int n)
|
|||
struct snd_opl3 *opl3;
|
||||
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) {
|
||||
dev_err(dev, "could not create card\n");
|
||||
return error;
|
||||
|
@ -83,8 +83,6 @@ static int snd_adlib_probe(struct device *dev, unsigned int n)
|
|||
goto out;
|
||||
}
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
error = snd_card_register(card);
|
||||
if (error < 0) {
|
||||
dev_err(dev, "could not register card\n");
|
||||
|
|
|
@ -193,7 +193,8 @@ static int snd_card_als100_probe(int dev,
|
|||
struct snd_card_als100 *acard;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
error = snd_card_new(&pcard->card->dev,
|
||||
index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_als100), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -203,7 +204,6 @@ static int snd_card_als100_probe(int dev,
|
|||
snd_card_free(card);
|
||||
return error;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
||||
if (pid->driver_data == SB_HW_DT019X)
|
||||
dma16[dev] = -1;
|
||||
|
|
|
@ -184,7 +184,8 @@ static int snd_card_azt2320_probe(int dev,
|
|||
struct snd_wss *chip;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
error = snd_card_new(&pcard->card->dev,
|
||||
index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_azt2320), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -194,7 +195,6 @@ static int snd_card_azt2320_probe(int dev,
|
|||
snd_card_free(card);
|
||||
return error;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
||||
if ((error = snd_card_azt2320_enable_wss(port[dev]))) {
|
||||
snd_card_free(card);
|
||||
|
|
|
@ -293,7 +293,7 @@ static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)
|
|||
}
|
||||
outb(val, port);
|
||||
|
||||
err = snd_card_create(index[ndev], id[ndev], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[ndev], id[ndev], THIS_MODULE,
|
||||
sizeof(struct snd_cmi8328), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -301,7 +301,6 @@ static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)
|
|||
cmi->card = card;
|
||||
cmi->port = port;
|
||||
cmi->wss_cfg = val;
|
||||
snd_card_set_dev(card, pdev);
|
||||
|
||||
err = snd_wss_create(card, port + 4, -1, irq[ndev], dma1[ndev],
|
||||
dma2[ndev], WSS_HW_DETECT, 0, &cmi->wss);
|
||||
|
|
|
@ -514,13 +514,14 @@ static int snd_cmi8330_resume(struct snd_card *card)
|
|||
|
||||
#define PFX "cmi8330: "
|
||||
|
||||
static int snd_cmi8330_card_new(int dev, struct snd_card **cardp)
|
||||
static int snd_cmi8330_card_new(struct device *pdev, int dev,
|
||||
struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
struct snd_cmi8330 *acard;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_cmi8330), &card);
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR PFX "could not get a new card\n");
|
||||
|
@ -635,10 +636,9 @@ static int snd_cmi8330_isa_probe(struct device *pdev,
|
|||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_cmi8330_card_new(dev, &card);
|
||||
err = snd_cmi8330_card_new(pdev, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
snd_card_set_dev(card, pdev);
|
||||
if ((err = snd_cmi8330_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -698,7 +698,7 @@ static int snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
|
|||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
res = snd_cmi8330_card_new(dev, &card);
|
||||
res = snd_cmi8330_card_new(&pcard->card->dev, dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) {
|
||||
|
@ -706,7 +706,6 @@ static int snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
|
|||
snd_card_free(card);
|
||||
return res;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
if ((res = snd_cmi8330_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return res;
|
||||
|
|
|
@ -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,12 +364,13 @@ 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,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_cs4236), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -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;
|
||||
|
|
|
@ -187,7 +187,7 @@ static int snd_es1688_isa_probe(struct device *dev, unsigned int n)
|
|||
struct snd_card *card;
|
||||
int error;
|
||||
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE,
|
||||
error = snd_card_new(dev, index[n], id[n], THIS_MODULE,
|
||||
sizeof(struct snd_es1688), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -196,8 +196,6 @@ static int snd_es1688_isa_probe(struct device *dev, unsigned int n)
|
|||
if (error < 0)
|
||||
goto out;
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
error = snd_es1688_probe(card, n);
|
||||
if (error < 0)
|
||||
goto out;
|
||||
|
@ -274,7 +272,8 @@ static int snd_es968_pnp_detect(struct pnp_card_link *pcard,
|
|||
if (dev == SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
error = snd_card_new(&pcard->card->dev,
|
||||
index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_es1688), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -285,7 +284,6 @@ static int snd_es968_pnp_detect(struct pnp_card_link *pcard,
|
|||
snd_card_free(card);
|
||||
return error;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
error = snd_es1688_probe(card, dev);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
|
|
@ -2105,9 +2105,10 @@ static int snd_audiodrive_pnpc(int dev, struct snd_es18xx *chip,
|
|||
#define is_isapnp_selected(dev) 0
|
||||
#endif
|
||||
|
||||
static int snd_es18xx_card_new(int dev, struct snd_card **cardp)
|
||||
static int snd_es18xx_card_new(struct device *pdev, int dev,
|
||||
struct snd_card **cardp)
|
||||
{
|
||||
return snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
return snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_es18xx), cardp);
|
||||
}
|
||||
|
||||
|
@ -2179,10 +2180,9 @@ static int snd_es18xx_isa_probe1(int dev, struct device *devptr)
|
|||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_es18xx_card_new(dev, &card);
|
||||
err = snd_es18xx_card_new(devptr, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
snd_card_set_dev(card, devptr);
|
||||
if ((err = snd_audiodrive_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -2284,14 +2284,13 @@ static int snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
|
|||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
err = snd_es18xx_card_new(dev, &card);
|
||||
err = snd_es18xx_card_new(&pdev->dev, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
snd_card_set_dev(card, &pdev->dev);
|
||||
if ((err = snd_audiodrive_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -2342,7 +2341,7 @@ static int snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard,
|
|||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
res = snd_es18xx_card_new(dev, &card);
|
||||
res = snd_es18xx_card_new(&pcard->card->dev, dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
@ -2350,7 +2349,6 @@ static int snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard,
|
|||
snd_card_free(card);
|
||||
return res;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
if ((res = snd_audiodrive_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return res;
|
||||
|
|
|
@ -506,13 +506,11 @@ static int snd_galaxy_probe(struct device *dev, unsigned int n)
|
|||
u8 type;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[n], id[n], THIS_MODULE, sizeof *galaxy,
|
||||
&card);
|
||||
err = snd_card_new(dev, index[n], id[n], THIS_MODULE,
|
||||
sizeof(*galaxy), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
card->private_free = snd_galaxy_free;
|
||||
galaxy = card->private_data;
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ static int snd_gusclassic_probe(struct device *dev, unsigned int n)
|
|||
struct snd_gus_card *gus;
|
||||
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;
|
||||
|
||||
|
@ -199,8 +199,6 @@ static int snd_gusclassic_probe(struct device *dev, unsigned int n)
|
|||
sprintf(card->longname + strlen(card->longname),
|
||||
"&%d", gus->gf1.dma2);
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
error = snd_card_register(card);
|
||||
if (error < 0)
|
||||
goto out;
|
||||
|
|
|
@ -242,7 +242,7 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n)
|
|||
struct snd_opl3 *opl3;
|
||||
int error;
|
||||
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE,
|
||||
error = snd_card_new(dev, index[n], id[n], THIS_MODULE,
|
||||
sizeof(struct snd_es1688), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -328,8 +328,6 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n)
|
|||
"irq %i&%i, dma %i&%i", es1688->port,
|
||||
gus->gf1.irq, es1688->irq, gus->gf1.dma1, es1688->dma8);
|
||||
|
||||
snd_card_set_dev(card, dev);
|
||||
|
||||
error = snd_card_register(card);
|
||||
if (error < 0)
|
||||
goto out;
|
||||
|
|
|
@ -214,7 +214,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
|
|||
struct snd_wss *wss;
|
||||
struct snd_gusmax *maxcard;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_gusmax), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -337,8 +337,6 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
|
|||
if (xdma2 >= 0)
|
||||
sprintf(card->longname + strlen(card->longname), "&%i", xdma2);
|
||||
|
||||
snd_card_set_dev(card, pdev);
|
||||
|
||||
err = snd_card_register(card);
|
||||
if (err < 0)
|
||||
goto _err;
|
||||
|
|
|
@ -625,13 +625,14 @@ static void snd_interwave_free(struct snd_card *card)
|
|||
free_irq(iwcard->irq, (void *)iwcard);
|
||||
}
|
||||
|
||||
static int snd_interwave_card_new(int dev, struct snd_card **cardp)
|
||||
static int snd_interwave_card_new(struct device *pdev, int dev,
|
||||
struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
struct snd_interwave *iwcard;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_interwave), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -779,11 +780,10 @@ static int snd_interwave_isa_probe1(int dev, struct device *devptr)
|
|||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_interwave_card_new(dev, &card);
|
||||
err = snd_interwave_card_new(devptr, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
snd_card_set_dev(card, devptr);
|
||||
if ((err = snd_interwave_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -876,7 +876,7 @@ static int snd_interwave_pnp_detect(struct pnp_card_link *pcard,
|
|||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
res = snd_interwave_card_new(dev, &card);
|
||||
res = snd_interwave_card_new(&pcard->card->dev, dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
@ -884,7 +884,6 @@ static int snd_interwave_pnp_detect(struct pnp_card_link *pcard,
|
|||
snd_card_free(card);
|
||||
return res;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
if ((res = snd_interwave_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return res;
|
||||
|
|
|
@ -905,12 +905,11 @@ static int snd_msnd_isa_probe(struct device *pdev, unsigned int idx)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
err = snd_card_create(index[idx], id[idx], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[idx], id[idx], THIS_MODULE,
|
||||
sizeof(struct snd_msnd), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
snd_card_set_dev(card, pdev);
|
||||
chip = card->private_data;
|
||||
chip->card = card;
|
||||
|
||||
|
@ -1122,14 +1121,14 @@ static int snd_msnd_pnp_detect(struct pnp_card_link *pcard,
|
|||
* Create a new ALSA sound card entry, in anticipation
|
||||
* of detecting our hardware ...
|
||||
*/
|
||||
ret = snd_card_create(index[idx], id[idx], THIS_MODULE,
|
||||
ret = snd_card_new(&pcard->card->dev,
|
||||
index[idx], id[idx], THIS_MODULE,
|
||||
sizeof(struct snd_msnd), &card);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
chip = card->private_data;
|
||||
chip->card = card;
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
||||
/*
|
||||
* Read the correct parameters off the ISA PnP bus ...
|
||||
|
|
|
@ -627,13 +627,14 @@ 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,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_opl3sa2), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -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;
|
||||
|
|
|
@ -1411,7 +1411,7 @@ static int snd_miro_isa_probe(struct device *devptr, unsigned int n)
|
|||
struct snd_miro *miro;
|
||||
struct snd_card *card;
|
||||
|
||||
error = snd_card_create(index, id, THIS_MODULE,
|
||||
error = snd_card_new(devptr, index, id, THIS_MODULE,
|
||||
sizeof(struct snd_miro), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
@ -1479,8 +1479,6 @@ static int snd_miro_isa_probe(struct device *devptr, unsigned int n)
|
|||
}
|
||||
}
|
||||
|
||||
snd_card_set_dev(card, devptr);
|
||||
|
||||
error = snd_miro_probe(card);
|
||||
if (error < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -1584,7 +1582,7 @@ static int snd_miro_pnp_probe(struct pnp_card_link *pcard,
|
|||
return -EBUSY;
|
||||
if (!isapnp)
|
||||
return -ENODEV;
|
||||
err = snd_card_create(index, id, THIS_MODULE,
|
||||
err = snd_card_new(&pcard->card->dev, index, id, THIS_MODULE,
|
||||
sizeof(struct snd_miro), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -1612,7 +1610,6 @@ static int snd_miro_pnp_probe(struct pnp_card_link *pcard,
|
|||
return err;
|
||||
}
|
||||
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
err = snd_miro_probe(card);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
|
|
|
@ -934,12 +934,12 @@ static int snd_opti9xx_probe(struct snd_card *card)
|
|||
return snd_card_register(card);
|
||||
}
|
||||
|
||||
static int snd_opti9xx_card_new(struct snd_card **cardp)
|
||||
static int snd_opti9xx_card_new(struct device *pdev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index, id, THIS_MODULE,
|
||||
err = snd_card_new(pdev, index, id, THIS_MODULE,
|
||||
sizeof(struct snd_opti9xx), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -1010,7 +1010,7 @@ static int snd_opti9xx_isa_probe(struct device *devptr,
|
|||
}
|
||||
#endif
|
||||
|
||||
error = snd_opti9xx_card_new(&card);
|
||||
error = snd_opti9xx_card_new(devptr, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
|
@ -1018,7 +1018,6 @@ static int snd_opti9xx_isa_probe(struct device *devptr,
|
|||
snd_card_free(card);
|
||||
return error;
|
||||
}
|
||||
snd_card_set_dev(card, devptr);
|
||||
if ((error = snd_opti9xx_probe(card)) < 0) {
|
||||
snd_card_free(card);
|
||||
return error;
|
||||
|
@ -1100,7 +1099,7 @@ static int snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
|
|||
return -EBUSY;
|
||||
if (! isapnp)
|
||||
return -ENODEV;
|
||||
error = snd_opti9xx_card_new(&card);
|
||||
error = snd_opti9xx_card_new(&pcard->card->dev, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
chip = card->private_data;
|
||||
|
@ -1131,7 +1130,6 @@ static int snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
|
|||
snd_card_free(card);
|
||||
return error;
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
if ((error = snd_opti9xx_probe(card)) < 0) {
|
||||
snd_card_free(card);
|
||||
return error;
|
||||
|
|
|
@ -229,7 +229,7 @@ static int snd_jazz16_probe(struct device *devptr, unsigned int dev)
|
|||
static int possible_dmas16[] = {5, 7, -1};
|
||||
int err, xirq, xdma8, xdma16, xmpu_port, xmpu_irq;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(devptr, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_jazz16), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -327,8 +327,6 @@ static int snd_jazz16_probe(struct device *devptr, unsigned int dev)
|
|||
mpu_port[dev]);
|
||||
}
|
||||
|
||||
snd_card_set_dev(card, devptr);
|
||||
|
||||
err = snd_card_register(card);
|
||||
if (err < 0)
|
||||
goto err_free;
|
||||
|
|
|
@ -323,12 +323,13 @@ static void snd_sb16_free(struct snd_card *card)
|
|||
#define is_isapnp_selected(dev) 0
|
||||
#endif
|
||||
|
||||
static int snd_sb16_card_new(int dev, struct snd_card **cardp)
|
||||
static int snd_sb16_card_new(struct device *devptr, int dev,
|
||||
struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(devptr, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_sb16), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -493,7 +494,7 @@ static int snd_sb16_isa_probe1(int dev, struct device *pdev)
|
|||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_sb16_card_new(dev, &card);
|
||||
err = snd_sb16_card_new(pdev, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
@ -507,7 +508,6 @@ static int snd_sb16_isa_probe1(int dev, struct device *pdev)
|
|||
awe_port[dev] = port[dev] + 0x400;
|
||||
#endif
|
||||
|
||||
snd_card_set_dev(card, pdev);
|
||||
if ((err = snd_sb16_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -613,10 +613,9 @@ static int snd_sb16_pnp_detect(struct pnp_card_link *pcard,
|
|||
for ( ; dev < SNDRV_CARDS; dev++) {
|
||||
if (!enable[dev] || !isapnp[dev])
|
||||
continue;
|
||||
res = snd_sb16_card_new(dev, &card);
|
||||
res = snd_sb16_card_new(&pcard->card->dev, dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
if ((res = snd_card_sb16_pnp(dev, card->private_data, pcard, pid)) < 0 ||
|
||||
(res = snd_sb16_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
|
|
@ -102,7 +102,7 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
|
|||
struct snd_opl3 *opl3;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_sb8), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -192,8 +192,6 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
|
|||
chip->port,
|
||||
irq[dev], dma8[dev]);
|
||||
|
||||
snd_card_set_dev(card, pdev);
|
||||
|
||||
if ((err = snd_card_register(card)) < 0)
|
||||
goto _err;
|
||||
|
||||
|
|
|
@ -559,8 +559,8 @@ static int snd_sc6000_probe(struct device *devptr, unsigned int dev)
|
|||
char __iomem *vmss_port;
|
||||
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, sizeof(vport),
|
||||
&card);
|
||||
err = snd_card_new(devptr, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(vport), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
@ -668,8 +668,6 @@ static int snd_sc6000_probe(struct device *devptr, unsigned int dev)
|
|||
sprintf(card->longname, "Gallant SC-6000 at 0x%lx, irq %d, dma %d",
|
||||
mss_port[dev], xirq, xdma);
|
||||
|
||||
snd_card_set_dev(card, devptr);
|
||||
|
||||
err = snd_card_register(card);
|
||||
if (err < 0)
|
||||
goto err_unmap2;
|
||||
|
|
|
@ -1169,7 +1169,7 @@ static int snd_sscape_probe(struct device *pdev, unsigned int dev)
|
|||
struct soundscape *sscape;
|
||||
int ret;
|
||||
|
||||
ret = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
ret = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct soundscape), &card);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -1178,7 +1178,6 @@ static int snd_sscape_probe(struct device *pdev, unsigned int dev)
|
|||
sscape->type = SSCAPE;
|
||||
|
||||
dma[dev] &= 0x03;
|
||||
snd_card_set_dev(card, pdev);
|
||||
|
||||
ret = create_sscape(dev, card);
|
||||
if (ret < 0)
|
||||
|
@ -1259,7 +1258,8 @@ static int sscape_pnp_detect(struct pnp_card_link *pcard,
|
|||
* Create a new ALSA sound card entry, in anticipation
|
||||
* of detecting our hardware ...
|
||||
*/
|
||||
ret = snd_card_create(index[idx], id[idx], THIS_MODULE,
|
||||
ret = snd_card_new(&pcard->card->dev,
|
||||
index[idx], id[idx], THIS_MODULE,
|
||||
sizeof(struct soundscape), &card);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -1288,7 +1288,6 @@ static int sscape_pnp_detect(struct pnp_card_link *pcard,
|
|||
wss_port[idx] = pnp_port_start(dev, 1);
|
||||
dma2[idx] = pnp_dma(dev, 1);
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
||||
ret = create_sscape(idx, card);
|
||||
if (ret < 0)
|
||||
|
|
|
@ -334,13 +334,14 @@ snd_wavefront_free(struct snd_card *card)
|
|||
}
|
||||
}
|
||||
|
||||
static int snd_wavefront_card_new(int dev, struct snd_card **cardp)
|
||||
static int snd_wavefront_card_new(struct device *pdev, int dev,
|
||||
struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
snd_wavefront_card_t *acard;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
err = snd_card_new(pdev, index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(snd_wavefront_card_t), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
@ -564,10 +565,9 @@ static int snd_wavefront_isa_probe(struct device *pdev,
|
|||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_wavefront_card_new(dev, &card);
|
||||
err = snd_wavefront_card_new(pdev, dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
snd_card_set_dev(card, pdev);
|
||||
if ((err = snd_wavefront_probe(card, dev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -612,7 +612,7 @@ static int snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
|
|||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
res = snd_wavefront_card_new(dev, &card);
|
||||
res = snd_wavefront_card_new(&pcard->card->dev, dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
@ -623,7 +623,6 @@ static int snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
|
|||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
||||
if ((res = snd_wavefront_probe(card, dev)) < 0)
|
||||
return res;
|
||||
|
|
Загрузка…
Ссылка в новой задаче