Skip to content

Commit

Permalink
ALSA: Convert to snd_card_create() in other sound/*
Browse files Browse the repository at this point in the history
Convert from snd_card_new() to the new snd_card_create() function
in other sound subdirectories.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Takashi Iwai authored and tiwai committed Jan 12, 2009
1 parent e58de7b commit bd7dd77
Show file tree
Hide file tree
Showing 31 changed files with 111 additions and 103 deletions.
7 changes: 4 additions & 3 deletions sound/aoa/core/alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ int aoa_alsa_init(char *name, struct module *mod, struct device *dev)
/* cannot be EEXIST due to usage in aoa_fabric_register */
return -EBUSY;

alsa_card = snd_card_new(index, name, mod, sizeof(struct aoa_card));
if (!alsa_card)
return -ENOMEM;
err = snd_card_create(index, name, mod, sizeof(struct aoa_card),
&alsa_card);
if (err < 0)
return err;
aoa_card = alsa_card->private_data;
aoa_card->alsa_card = alsa_card;
alsa_card->dev = dev;
Expand Down
7 changes: 4 additions & 3 deletions sound/arm/aaci.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,10 +995,11 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev)
{
struct aaci *aaci;
struct snd_card *card;
int err;

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

card->private_free = aaci_free_card;
Expand Down
7 changes: 3 additions & 4 deletions sound/arm/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
struct snd_ac97_template ac97_template;
int ret;

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

card->dev = &dev->dev;
Expand Down
7 changes: 4 additions & 3 deletions sound/arm/sa11xx-uda1341.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,10 @@ static int __devinit sa11xx_uda1341_probe(struct platform_device *devptr)
struct sa11xx_uda1341 *chip;

/* register the soundcard */
card = snd_card_new(-1, id, THIS_MODULE, sizeof(struct sa11xx_uda1341));
if (card == NULL)
return -ENOMEM;
err = snd_card_create(-1, id, THIS_MODULE,
sizeof(struct sa11xx_uda1341), &card);
if (err < 0)
return err;

chip = card->private_data;
spin_lock_init(&chip->s[0].dma_lock);
Expand Down
8 changes: 4 additions & 4 deletions sound/drivers/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
int idx, err;
int dev = devptr->id;

card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_dummy));
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_dummy), &card);
if (err < 0)
return err;
dummy = card->private_data;
dummy->card = card;
for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/ml403-ac97cr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,9 +1279,9 @@ static int __devinit snd_ml403_ac97cr_probe(struct platform_device *pfdev)
if (!enable[dev])
return -ENOENT;

card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
if (err < 0)
return err;
err = snd_ml403_ac97cr_create(card, pfdev, &ml403_ac97cr);
if (err < 0) {
PDEBUG(INIT_FAILURE, "probe(): create failed!\n");
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/mpu401/mpu401.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ static int snd_mpu401_create(int dev, struct snd_card **rcard)
snd_printk(KERN_ERR "the uart_enter option is obsolete; remove it\n");

*rcard = NULL;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
if (err < 0)
return err;
strcpy(card->driver, "MPU-401 UART");
strcpy(card->shortname, card->driver);
sprintf(card->longname, "%s at %#lx, ", card->shortname, port[dev]);
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/mtpav.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
int err;
struct mtpav *mtp_card;

card = snd_card_new(index, id, THIS_MODULE, sizeof(*mtp_card));
if (! card)
return -ENOMEM;
err = snd_card_create(index, id, THIS_MODULE, sizeof(*mtp_card), &card);
if (err < 0)
return err;

mtp_card = card->private_data;
spin_lock_init(&mtp_card->spinlock);
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/mts64.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,10 @@ static int __devinit snd_mts64_probe(struct platform_device *pdev)
if ((err = snd_mts64_probe_port(p)) < 0)
return err;

card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL) {
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
if (err < 0) {
snd_printd("Cannot create card\n");
return -ENOMEM;
return err;
}
strcpy(card->driver, DRIVER_NAME);
strcpy(card->shortname, "ESI " CARD_NAME);
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/pcsp/pcsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev)
hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
pcsp_chip.timer.function = pcsp_do_timer;

card = snd_card_new(index, id, THIS_MODULE, 0);
if (!card)
return -ENOMEM;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;

err = snd_pcsp_create(card);
if (err < 0) {
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/portman2x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,10 @@ static int __devinit snd_portman_probe(struct platform_device *pdev)
if ((err = snd_portman_probe_port(p)) < 0)
return err;

card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL) {
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
if (err < 0) {
snd_printd("Cannot create card\n");
return -ENOMEM;
return err;
}
strcpy(card->driver, DRIVER_NAME);
strcpy(card->shortname, CARD_NAME);
Expand Down
6 changes: 3 additions & 3 deletions sound/drivers/serial-u16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,9 @@ static int __devinit snd_serial_probe(struct platform_device *devptr)
return -ENODEV;
}

card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
if (err < 0)
return err;

strcpy(card->driver, "Serial");
strcpy(card->shortname, "Serial MIDI (UART16550A)");
Expand Down
8 changes: 4 additions & 4 deletions sound/drivers/virmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
int idx, err;
int dev = devptr->id;

card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_virmidi));
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_virmidi), &card);
if (err < 0)
return err;
vmidi = (struct snd_card_virmidi *)card->private_data;
vmidi->card = card;

Expand Down
7 changes: 4 additions & 3 deletions sound/mips/au1x00.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,10 @@ au1000_init(void)
struct snd_card *card;
struct snd_au1000 *au1000;

card = snd_card_new(-1, "AC97", THIS_MODULE, sizeof(struct snd_au1000));
if (card == NULL)
return -ENOMEM;
err = snd_card_create(-1, "AC97", THIS_MODULE,
sizeof(struct snd_au1000), &card);
if (err < 0)
return err;

card->private_free = snd_au1000_free;
au1000 = card->private_data;
Expand Down
6 changes: 3 additions & 3 deletions sound/mips/hal2.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,9 @@ static int __devinit hal2_probe(struct platform_device *pdev)
struct snd_hal2 *chip;
int err;

card = snd_card_new(index, id, THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;

err = hal2_create(card, &chip);
if (err < 0) {
Expand Down
6 changes: 3 additions & 3 deletions sound/mips/sgio2audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,9 @@ static int __devinit snd_sgio2audio_probe(struct platform_device *pdev)
struct snd_sgio2audio *chip;
int err;

card = snd_card_new(index, id, THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;

err = snd_sgio2audio_create(card, &chip);
if (err < 0) {
Expand Down
6 changes: 3 additions & 3 deletions sound/parisc/harmony.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,9 +975,9 @@ snd_harmony_probe(struct parisc_device *padev)
struct snd_card *card;
struct snd_harmony *h;

card = snd_card_new(index, id, THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;

err = snd_harmony_create(card, padev, &h);
if (err < 0)
Expand Down
8 changes: 4 additions & 4 deletions sound/pcmcia/pdaudiocf/pdaudiocf.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int snd_pdacf_dev_free(struct snd_device *device)
*/
static int snd_pdacf_probe(struct pcmcia_device *link)
{
int i;
int i, err;
struct snd_pdacf *pdacf;
struct snd_card *card;
static struct snd_device_ops ops = {
Expand All @@ -112,10 +112,10 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
return -ENODEV; /* disabled explicitly */

/* ok, create a card instance */
card = snd_card_new(index[i], id[i], THIS_MODULE, 0);
if (card == NULL) {
err = snd_card_create(index[i], id[i], THIS_MODULE, 0, &card);
if (err < 0) {
snd_printk(KERN_ERR "pdacf: cannot create a card instance\n");
return -ENOMEM;
return err;
}

pdacf = snd_pdacf_create(card);
Expand Down
8 changes: 4 additions & 4 deletions sound/pcmcia/vx/vxpocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static int vxpocket_probe(struct pcmcia_device *p_dev)
{
struct snd_card *card;
struct snd_vxpocket *vxp;
int i;
int i, err;

/* find an empty slot from the card list */
for (i = 0; i < SNDRV_CARDS; i++) {
Expand All @@ -307,10 +307,10 @@ static int vxpocket_probe(struct pcmcia_device *p_dev)
return -ENODEV; /* disabled explicitly */

/* ok, create a card instance */
card = snd_card_new(index[i], id[i], THIS_MODULE, 0);
if (card == NULL) {
err = snd_card_create(index[i], id[i], THIS_MODULE, 0, &card);
if (err < 0) {
snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n");
return -ENOMEM;
return err;
}

vxp = snd_vxpocket_new(card, ibl[i], p_dev);
Expand Down
6 changes: 3 additions & 3 deletions sound/ppc/powermac.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ static int __init snd_pmac_probe(struct platform_device *devptr)
char *name_ext;
int err;

card = snd_card_new(index, id, THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
if (err < 0)
return err;

if ((err = snd_pmac_new(card, &chip)) < 0)
goto __error;
Expand Down
6 changes: 2 additions & 4 deletions sound/ppc/snd_ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,9 @@ static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
}

/* create card instance */
the_card.card = snd_card_new(index, id, THIS_MODULE, 0);
if (!the_card.card) {
ret = -ENXIO;
ret = snd_card_create(index, id, THIS_MODULE, 0, &the_card.card);
if (ret < 0)
goto clean_irq;
}

strcpy(the_card.card->driver, "PS3");
strcpy(the_card.card->shortname, "PS3");
Expand Down
8 changes: 4 additions & 4 deletions sound/sh/aica.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,11 @@ static int __devinit snd_aica_probe(struct platform_device *devptr)
dreamcastcard = kmalloc(sizeof(struct snd_card_aica), GFP_KERNEL);
if (unlikely(!dreamcastcard))
return -ENOMEM;
dreamcastcard->card =
snd_card_new(index, SND_AICA_DRIVER, THIS_MODULE, 0);
if (unlikely(!dreamcastcard->card)) {
err = snd_card_create(index, SND_AICA_DRIVER, THIS_MODULE, 0,
&dreamcastcard->card);
if (unlikely(err < 0)) {
kfree(dreamcastcard);
return -ENODEV;
return err;
}
strcpy(dreamcastcard->card->driver, "snd_aica");
strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER);
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,17 +1311,17 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
{
struct snd_soc_codec *codec = socdev->codec;
struct snd_soc_card *card = socdev->card;
int ret = 0, i;
int ret, i;

mutex_lock(&codec->mutex);

/* register a sound card */
codec->card = snd_card_new(idx, xid, codec->owner, 0);
if (!codec->card) {
ret = snd_card_create(idx, xid, codec->owner, 0, &codec->card);
if (ret < 0) {
printk(KERN_ERR "asoc: can't create sound card for codec %s\n",
codec->name);
mutex_unlock(&codec->mutex);
return -ENODEV;
return ret;
}

codec->card->dev = socdev->dev;
Expand Down
7 changes: 4 additions & 3 deletions sound/sparc/amd7930.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,10 @@ static int __devinit amd7930_sbus_probe(struct of_device *op, const struct of_de
return -ENOENT;
}

card = snd_card_new(index[dev_num], id[dev_num], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev_num], id[dev_num], THIS_MODULE, 0,
&card);
if (err < 0)
return err;

strcpy(card->driver, "AMD7930");
strcpy(card->shortname, "Sun AMD7930");
Expand Down
9 changes: 5 additions & 4 deletions sound/sparc/cs4231.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,7 @@ static int __init cs4231_attach_begin(struct snd_card **rcard)
{
struct snd_card *card;
struct snd_cs4231 *chip;
int err;

*rcard = NULL;

Expand All @@ -1574,10 +1575,10 @@ static int __init cs4231_attach_begin(struct snd_card **rcard)
return -ENOENT;
}

card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_cs4231));
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_cs4231), &card);
if (err < 0)
return err;

strcpy(card->driver, "CS4231");
strcpy(card->shortname, "Sun CS4231");
Expand Down
8 changes: 4 additions & 4 deletions sound/sparc/dbri.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,10 +2612,10 @@ static int __devinit dbri_probe(struct of_device *op, const struct of_device_id
return -ENODEV;
}

card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_dbri));
if (card == NULL)
return -ENOMEM;
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_dbri), &card);
if (err < 0)
return err;

strcpy(card->driver, "DBRI");
strcpy(card->shortname, "Sun DBRI");
Expand Down
Loading

0 comments on commit bd7dd77

Please sign in to comment.