Commit 60c5772b authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: pci: Convert to snd_card_new() with a device pointer



Also remove superfluous snd_card_set_dev() calls.
Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
parent 4323cc4d
......@@ -965,8 +965,6 @@ snd_ad1889_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
return 0;
......@@ -996,7 +994,8 @@ snd_ad1889_probe(struct pci_dev *pci,
}
/* (2) */
err = snd_card_create(index[devno], id[devno], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[devno], id[devno], THIS_MODULE,
0, &card);
/* XXX REVISIT: we can probably allocate chip in this call */
if (err < 0)
return err;
......
......@@ -2218,8 +2218,6 @@ static int snd_ali_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
/* initialise synth voices*/
for (i = 0; i < ALI_CHANNELS; i++)
codec->synth.voices[i].number = i;
......@@ -2253,7 +2251,7 @@ static int snd_ali_probe(struct pci_dev *pci,
snd_ali_printk("probe ...\n");
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;
......
......@@ -761,8 +761,6 @@ static int snd_als300_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
snd_als300_dbgcallleave();
return 0;
......@@ -829,7 +827,8 @@ static int snd_als300_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -888,9 +888,9 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
pci_set_master(pci);
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
sizeof(*acard) /* private_data: acard */,
&card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
sizeof(*acard) /* private_data: acard */,
&card);
if (err < 0) {
pci_release_regions(pci);
pci_disable_device(pci);
......@@ -920,7 +920,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
chip->pci = pci;
chip->alt_port = iobase;
snd_card_set_dev(card, &pci->dev);
snd_als4000_configure(chip);
......
......@@ -2827,17 +2827,13 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
hpi = pci_get_drvdata(pci_dev);
adapter_index = hpi->adapter->index;
/* first try to give the card the same index as its hardware index */
err = snd_card_create(adapter_index,
id[adapter_index], THIS_MODULE,
sizeof(struct snd_card_asihpi),
&card);
err = snd_card_new(&pci_dev->dev, adapter_index, id[adapter_index],
THIS_MODULE, sizeof(struct snd_card_asihpi), &card);
if (err < 0) {
/* if that fails, try the default index==next available */
err =
snd_card_create(index[dev], id[dev],
THIS_MODULE,
sizeof(struct snd_card_asihpi),
&card);
err = snd_card_new(&pci_dev->dev, index[dev], id[dev],
THIS_MODULE, sizeof(struct snd_card_asihpi),
&card);
if (err < 0)
return err;
snd_printk(KERN_WARNING
......@@ -2845,8 +2841,6 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
adapter_index, card->number);
}
snd_card_set_dev(card, &pci_dev->dev);
asihpi = card->private_data;
asihpi->card = card;
asihpi->pci = pci_dev;
......
......@@ -1657,8 +1657,6 @@ static int snd_atiixp_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
*r_chip = chip;
return 0;
}
......@@ -1671,7 +1669,7 @@ static int snd_atiixp_probe(struct pci_dev *pci,
struct atiixp *chip;
int err;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;
......
......@@ -1282,8 +1282,6 @@ static int snd_atiixp_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
*r_chip = chip;
return 0;
}
......@@ -1296,7 +1294,7 @@ static int snd_atiixp_probe(struct pci_dev *pci,
struct atiixp_modem *chip;
int err;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;
......
......@@ -211,8 +211,6 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
goto alloc_out;
}
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
return 0;
......@@ -250,7 +248,8 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
return -ENOENT;
}
// (2)
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -322,7 +322,6 @@ static int snd_aw2_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
printk(KERN_INFO
......@@ -349,7 +348,8 @@ static int snd_aw2_probe(struct pci_dev *pci,
}
/* (2) Create card instance */
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -2599,8 +2599,6 @@ snd_azf3328_create(struct snd_card *card,
spin_unlock_irq(codec->lock);
}
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
err = 0;
......@@ -2635,7 +2633,8 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
goto out;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
goto out;
......
......@@ -773,7 +773,6 @@ static int snd_bt87x_create(struct snd_card *card,
if (err < 0)
goto fail;
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
return 0;
......@@ -888,7 +887,8 @@ static int snd_bt87x_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -1843,7 +1843,8 @@ static int snd_ca0106_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......@@ -1878,8 +1879,6 @@ static int snd_ca0106_probe(struct pci_dev *pci,
snd_ca0106_proc_init(chip);
#endif
snd_card_set_dev(card, &pci->dev);
err = snd_card_register(card);
if (err < 0)
goto error;
......
......@@ -3254,8 +3254,6 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
if (snd_cmipci_create_gameport(cm, dev) < 0)
snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
snd_card_set_dev(card, &pci->dev);
*rcmipci = cm;
return 0;
}
......@@ -3280,7 +3278,8 @@ static int snd_cmipci_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -1402,8 +1402,6 @@ static int snd_cs4281_create(struct snd_card *card,
snd_cs4281_proc_init(chip);
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
return 0;
}
......@@ -1917,7 +1915,8 @@ static int snd_cs4281_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -88,7 +88,8 @@ static int snd_card_cs46xx_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
if ((err = snd_cs46xx_create(card, pci,
......
......@@ -4058,8 +4058,6 @@ int snd_cs46xx_create(struct snd_card *card,
chip->active_ctrl(chip, -1); /* disable CLKRUN */
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
return 0;
}
......@@ -244,7 +244,6 @@ static int snd_cs5530_create(struct snd_card *card,
return err;
}
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
return 0;
}
......@@ -264,7 +263,8 @@ static int snd_cs5530_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -324,8 +324,6 @@ static int snd_cs5535audio_create(struct snd_card *card,
cs5535au, &ops)) < 0)
goto sndfail;
snd_card_set_dev(card, &pci->dev);
*rcs5535au = cs5535au;
return 0;
......@@ -353,7 +351,8 @@ static int snd_cs5535audio_probe(struct pci_dev *pci,
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err < 0)
return err;
......
......@@ -1739,8 +1739,6 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
if (err < 0)
goto error1;
snd_card_set_dev(card, &pci->dev);
*ratc = atc;
return 0;
......
......@@ -71,7 +71,8 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
dev++;
return -ENOENT;
}
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
0, &card);
if (err)
return err;
if ((reference_rate != 48000) && (reference_rate != 44100)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment