mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 16:44:10 +08:00
Merge branch 'topic/snd_card_new-err' into topic/oxygen
This commit is contained in:
commit
a5e0e970c0
@ -492,9 +492,9 @@
|
||||
}
|
||||
|
||||
/* (2) */
|
||||
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;
|
||||
|
||||
/* (3) */
|
||||
err = snd_mychip_create(card, pci, &chip);
|
||||
@ -590,8 +590,9 @@
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
....
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
@ -809,26 +810,28 @@
|
||||
|
||||
<para>
|
||||
As mentioned above, to create a card instance, call
|
||||
<function>snd_card_new()</function>.
|
||||
<function>snd_card_create()</function>.
|
||||
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
struct snd_card *card;
|
||||
card = snd_card_new(index, id, module, extra_size);
|
||||
int err;
|
||||
err = snd_card_create(index, id, module, extra_size, &card);
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The function takes four arguments, the card-index number, the
|
||||
The function takes five arguments, the card-index number, the
|
||||
id string, the module pointer (usually
|
||||
<constant>THIS_MODULE</constant>),
|
||||
and the size of extra-data space. The last argument is used to
|
||||
the size of extra-data space, and the pointer to return the
|
||||
card instance. The extra_size argument is used to
|
||||
allocate card->private_data for the
|
||||
chip-specific data. Note that these data
|
||||
are allocated by <function>snd_card_new()</function>.
|
||||
are allocated by <function>snd_card_create()</function>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -915,15 +918,16 @@
|
||||
</para>
|
||||
|
||||
<section id="card-management-chip-specific-snd-card-new">
|
||||
<title>1. Allocating via <function>snd_card_new()</function>.</title>
|
||||
<title>1. Allocating via <function>snd_card_create()</function>.</title>
|
||||
<para>
|
||||
As mentioned above, you can pass the extra-data-length
|
||||
to the 4th argument of <function>snd_card_new()</function>, i.e.
|
||||
to the 4th argument of <function>snd_card_create()</function>, i.e.
|
||||
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct mychip));
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct mychip), &card);
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
@ -952,8 +956,8 @@
|
||||
|
||||
<para>
|
||||
After allocating a card instance via
|
||||
<function>snd_card_new()</function> (with
|
||||
<constant>NULL</constant> on the 4th arg), call
|
||||
<function>snd_card_create()</function> (with
|
||||
<constant>0</constant> on the 4th arg), call
|
||||
<function>kzalloc()</function>.
|
||||
|
||||
<informalexample>
|
||||
@ -961,7 +965,7 @@
|
||||
<![CDATA[
|
||||
struct snd_card *card;
|
||||
struct mychip *chip;
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
.....
|
||||
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
|
||||
]]>
|
||||
@ -5750,8 +5754,9 @@ struct _snd_pcm_runtime {
|
||||
....
|
||||
struct snd_card *card;
|
||||
struct mychip *chip;
|
||||
int err;
|
||||
....
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
....
|
||||
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
|
||||
....
|
||||
@ -5763,7 +5768,7 @@ struct _snd_pcm_runtime {
|
||||
</informalexample>
|
||||
|
||||
When you created the chip data with
|
||||
<function>snd_card_new()</function>, it's anyway accessible
|
||||
<function>snd_card_create()</function>, it's anyway accessible
|
||||
via <structfield>private_data</structfield> field.
|
||||
|
||||
<informalexample>
|
||||
@ -5775,9 +5780,10 @@ struct _snd_pcm_runtime {
|
||||
....
|
||||
struct snd_card *card;
|
||||
struct mychip *chip;
|
||||
int err;
|
||||
....
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct mychip));
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct mychip), &card);
|
||||
....
|
||||
chip = card->private_data;
|
||||
....
|
||||
|
@ -803,9 +803,10 @@ static int __devinit cx88_audio_initdev(struct pci_dev *pci,
|
||||
return (-ENOENT);
|
||||
}
|
||||
|
||||
card = snd_card_new(index[devno], id[devno], THIS_MODULE, sizeof(snd_cx88_card_t));
|
||||
if (!card)
|
||||
return (-ENOMEM);
|
||||
err = snd_card_create(index[devno], id[devno], THIS_MODULE,
|
||||
sizeof(snd_cx88_card_t), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
card->private_free = snd_cx88_dev_free;
|
||||
|
||||
|
@ -448,9 +448,10 @@ static int em28xx_audio_init(struct em28xx *dev)
|
||||
printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus "
|
||||
"Rechberger\n");
|
||||
|
||||
card = snd_card_new(index[devnr], "Em28xx Audio", THIS_MODULE, 0);
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[devnr], "Em28xx Audio", THIS_MODULE, 0,
|
||||
&card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
spin_lock_init(&adev->slock);
|
||||
err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
|
||||
|
@ -990,10 +990,10 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
|
||||
if (!enable[devnum])
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_card_new(index[devnum], id[devnum], THIS_MODULE, sizeof(snd_card_saa7134_t));
|
||||
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[devnum], id[devnum], THIS_MODULE,
|
||||
sizeof(snd_card_saa7134_t), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
strcpy(card->driver, "SAA7134");
|
||||
|
||||
|
@ -248,10 +248,11 @@ int go7007_snd_init(struct go7007 *go)
|
||||
spin_lock_init(&gosnd->lock);
|
||||
gosnd->hw_ptr = gosnd->w_idx = gosnd->avail = 0;
|
||||
gosnd->capturing = 0;
|
||||
gosnd->card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
if (gosnd->card == NULL) {
|
||||
ret = snd_card_create(index[dev], id[dev], THIS_MODULE, 0,
|
||||
&gosnd->card);
|
||||
if (ret < 0) {
|
||||
kfree(gosnd);
|
||||
return -ENOMEM;
|
||||
return ret;
|
||||
}
|
||||
ret = snd_device_new(gosnd->card, SNDRV_DEV_LOWLEVEL, go,
|
||||
&go7007_snd_device_ops);
|
||||
|
@ -1099,10 +1099,9 @@ static int gmidi_register_card(struct gmidi_device *dev)
|
||||
.dev_free = gmidi_snd_free,
|
||||
};
|
||||
|
||||
card = snd_card_new(index, id, THIS_MODULE, 0);
|
||||
if (!card) {
|
||||
ERROR(dev, "snd_card_new failed\n");
|
||||
err = -ENOMEM;
|
||||
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
|
||||
if (err < 0) {
|
||||
ERROR(dev, "snd_card_create failed\n");
|
||||
goto fail;
|
||||
}
|
||||
dev->card = card;
|
||||
|
@ -296,8 +296,20 @@ int snd_card_locked(int card);
|
||||
extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
|
||||
#endif
|
||||
|
||||
int snd_card_create(int idx, const char *id,
|
||||
struct module *module, int extra_size,
|
||||
struct snd_card **card_ret);
|
||||
|
||||
static inline __deprecated
|
||||
struct snd_card *snd_card_new(int idx, const char *id,
|
||||
struct module *module, int extra_size);
|
||||
struct module *module, int extra_size)
|
||||
{
|
||||
struct snd_card *card;
|
||||
if (snd_card_create(idx, id, module, extra_size, &card) < 0)
|
||||
return NULL;
|
||||
return card;
|
||||
}
|
||||
|
||||
int snd_card_disconnect(struct snd_card *card);
|
||||
int snd_card_free(struct snd_card *card);
|
||||
int snd_card_free_when_closed(struct snd_card *card);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -121,31 +121,44 @@ static inline int init_info_for_card(struct snd_card *card)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* snd_card_new - create and initialize a soundcard structure
|
||||
* snd_card_create - create and initialize a soundcard structure
|
||||
* @idx: card index (address) [0 ... (SNDRV_CARDS-1)]
|
||||
* @xid: card identification (ASCII string)
|
||||
* @module: top level module for locking
|
||||
* @extra_size: allocate this extra size after the main soundcard structure
|
||||
* @card_ret: the pointer to store the created card instance
|
||||
*
|
||||
* Creates and initializes a soundcard structure.
|
||||
*
|
||||
* Returns kmallocated snd_card structure. Creates the ALSA control interface
|
||||
* (which is blocked until snd_card_register function is called).
|
||||
* The function allocates snd_card instance via kzalloc with the given
|
||||
* space for the driver to use freely. The allocated struct is stored
|
||||
* in the given card_ret pointer.
|
||||
*
|
||||
* Returns zero if successful or a negative error code.
|
||||
*/
|
||||
struct snd_card *snd_card_new(int idx, const char *xid,
|
||||
struct module *module, int extra_size)
|
||||
int snd_card_create(int idx, const char *xid,
|
||||
struct module *module, int extra_size,
|
||||
struct snd_card **card_ret)
|
||||
{
|
||||
struct snd_card *card;
|
||||
int err, idx2;
|
||||
|
||||
if (snd_BUG_ON(!card_ret))
|
||||
return -EINVAL;
|
||||
*card_ret = NULL;
|
||||
|
||||
if (extra_size < 0)
|
||||
extra_size = 0;
|
||||
card = kzalloc(sizeof(*card) + extra_size, GFP_KERNEL);
|
||||
if (card == NULL)
|
||||
return NULL;
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
if (xid) {
|
||||
if (!snd_info_check_reserved_words(xid))
|
||||
if (!snd_info_check_reserved_words(xid)) {
|
||||
snd_printk(KERN_ERR
|
||||
"given id string '%s' is reserved.\n", xid);
|
||||
err = -EBUSY;
|
||||
goto __error;
|
||||
}
|
||||
strlcpy(card->id, xid, sizeof(card->id));
|
||||
}
|
||||
err = 0;
|
||||
@ -202,26 +215,28 @@ struct snd_card *snd_card_new(int idx, const char *xid,
|
||||
#endif
|
||||
/* the control interface cannot be accessed from the user space until */
|
||||
/* snd_cards_bitmask and snd_cards are set with snd_card_register */
|
||||
if ((err = snd_ctl_create(card)) < 0) {
|
||||
snd_printd("unable to register control minors\n");
|
||||
err = snd_ctl_create(card);
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR "unable to register control minors\n");
|
||||
goto __error;
|
||||
}
|
||||
if ((err = snd_info_card_create(card)) < 0) {
|
||||
snd_printd("unable to create card info\n");
|
||||
err = snd_info_card_create(card);
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR "unable to create card info\n");
|
||||
goto __error_ctl;
|
||||
}
|
||||
if (extra_size > 0)
|
||||
card->private_data = (char *)card + sizeof(struct snd_card);
|
||||
return card;
|
||||
*card_ret = card;
|
||||
return 0;
|
||||
|
||||
__error_ctl:
|
||||
snd_device_free_all(card, SNDRV_DEV_CMD_PRE);
|
||||
__error:
|
||||
kfree(card);
|
||||
return NULL;
|
||||
return err;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(snd_card_new);
|
||||
EXPORT_SYMBOL(snd_card_create);
|
||||
|
||||
/* return non-zero if a card is already locked */
|
||||
int snd_card_locked(int card)
|
||||
|
@ -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++) {
|
||||
|
@ -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");
|
||||
|
@ -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]);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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)");
|
||||
|
@ -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;
|
||||
|
||||
|
@ -157,9 +157,10 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
|
||||
struct snd_ad1816a *chip;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_ad1816a))) == NULL)
|
||||
return -ENOMEM;
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_ad1816a), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
acard = (struct snd_card_ad1816a *)card->private_data;
|
||||
|
||||
if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) {
|
||||
|
@ -91,9 +91,9 @@ static int __devinit snd_ad1848_probe(struct device *dev, unsigned int n)
|
||||
struct snd_pcm *pcm;
|
||||
int error;
|
||||
|
||||
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -EINVAL;
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], -1,
|
||||
thinkpad[n] ? WSS_HW_THINKPAD : WSS_HW_DETECT,
|
||||
|
@ -53,10 +53,10 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
|
||||
struct snd_opl3 *opl3;
|
||||
int error;
|
||||
|
||||
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
|
||||
if (!card) {
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0) {
|
||||
dev_err(dev, "could not create card\n");
|
||||
return -EINVAL;
|
||||
return error;
|
||||
}
|
||||
|
||||
card->private_data = request_region(port[n], 4, CRD_NAME);
|
||||
|
@ -163,9 +163,10 @@ static int __devinit snd_card_als100_probe(int dev,
|
||||
struct snd_card_als100 *acard;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_als100))) == NULL)
|
||||
return -ENOMEM;
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_als100), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
acard = card->private_data;
|
||||
|
||||
if ((error = snd_card_als100_pnp(dev, acard, pcard, pid))) {
|
||||
|
@ -184,9 +184,10 @@ static int __devinit snd_card_azt2320_probe(int dev,
|
||||
struct snd_wss *chip;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_azt2320))) == NULL)
|
||||
return -ENOMEM;
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_azt2320), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
acard = (struct snd_card_azt2320 *)card->private_data;
|
||||
|
||||
if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
|
||||
|
@ -467,20 +467,22 @@ static int snd_cmi8330_resume(struct snd_card *card)
|
||||
|
||||
#define PFX "cmi8330: "
|
||||
|
||||
static struct snd_card *snd_cmi8330_card_new(int dev)
|
||||
static int snd_cmi8330_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
struct snd_cmi8330 *acard;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_cmi8330));
|
||||
if (card == NULL) {
|
||||
err = snd_card_create(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");
|
||||
return NULL;
|
||||
return err;
|
||||
}
|
||||
acard = card->private_data;
|
||||
acard->card = card;
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
|
||||
@ -564,9 +566,9 @@ static int __devinit snd_cmi8330_isa_probe(struct device *pdev,
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_cmi8330_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_cmi8330_card_new(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);
|
||||
@ -628,9 +630,9 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_cmi8330_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_cmi8330_card_new(dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) {
|
||||
snd_printk(KERN_ERR PFX "PnP detection failed\n");
|
||||
snd_card_free(card);
|
||||
|
@ -95,9 +95,9 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n)
|
||||
struct snd_pcm *pcm;
|
||||
int error;
|
||||
|
||||
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -EINVAL;
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n],
|
||||
WSS_HW_DETECT, 0, &chip);
|
||||
|
@ -382,16 +382,18 @@ static void snd_card_cs4236_free(struct snd_card *card)
|
||||
release_and_free_resource(acard->res_sb_port);
|
||||
}
|
||||
|
||||
static struct snd_card *snd_cs423x_card_new(int dev)
|
||||
static int snd_cs423x_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_cs4236));
|
||||
if (card == NULL)
|
||||
return NULL;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_cs4236), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_card_cs4236_free;
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
|
||||
@ -512,9 +514,9 @@ static int __devinit snd_cs423x_isa_probe(struct device *pdev,
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_cs423x_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_cs423x_card_new(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);
|
||||
@ -594,9 +596,9 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_cs423x_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_cs423x_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) {
|
||||
printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n");
|
||||
snd_card_free(card);
|
||||
@ -656,9 +658,9 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_cs423x_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_cs423x_card_new(dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) {
|
||||
printk(KERN_ERR "isapnp detection failed and probing for " IDENT
|
||||
" is not supported\n");
|
||||
|
@ -150,9 +150,10 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard,
|
||||
struct snd_card_dt019x *acard;
|
||||
struct snd_opl3 *opl3;
|
||||
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_dt019x))) == NULL)
|
||||
return -ENOMEM;
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_dt019x), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
acard = card->private_data;
|
||||
|
||||
snd_card_set_dev(card, &pcard->card->dev);
|
||||
|
@ -122,9 +122,9 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n)
|
||||
struct snd_pcm *pcm;
|
||||
int error;
|
||||
|
||||
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -EINVAL;
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
error = snd_es1688_legacy_create(card, dev, n, &chip);
|
||||
if (error < 0)
|
||||
|
@ -2125,10 +2125,10 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard,
|
||||
#define is_isapnp_selected(dev) 0
|
||||
#endif
|
||||
|
||||
static struct snd_card *snd_es18xx_card_new(int dev)
|
||||
static int snd_es18xx_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
return snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_audiodrive));
|
||||
return snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_audiodrive), cardp);
|
||||
}
|
||||
|
||||
static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev)
|
||||
@ -2197,9 +2197,9 @@ static int __devinit snd_es18xx_isa_probe1(int dev, struct device *devptr)
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_es18xx_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_es18xx_card_new(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);
|
||||
@ -2303,9 +2303,9 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_es18xx_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_es18xx_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
@ -2362,9 +2362,9 @@ static int __devinit snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_es18xx_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_es18xx_card_new(dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -148,9 +148,9 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
|
||||
struct snd_gus_card *gus;
|
||||
int error;
|
||||
|
||||
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -EINVAL;
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
if (pcm_channels[n] < 2)
|
||||
pcm_channels[n] = 2;
|
||||
|
@ -241,9 +241,9 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
|
||||
struct snd_opl3 *opl3;
|
||||
int error;
|
||||
|
||||
card = snd_card_new(index[n], id[n], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -EINVAL;
|
||||
error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
if (mpu_port[n] == SNDRV_AUTO_PORT)
|
||||
mpu_port[n] = 0;
|
||||
|
@ -214,10 +214,10 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
|
||||
struct snd_wss *wss;
|
||||
struct snd_gusmax *maxcard;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_gusmax));
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_gusmax), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_gusmax_free;
|
||||
maxcard = (struct snd_gusmax *)card->private_data;
|
||||
maxcard->card = card;
|
||||
|
@ -626,20 +626,22 @@ static void snd_interwave_free(struct snd_card *card)
|
||||
free_irq(iwcard->irq, (void *)iwcard);
|
||||
}
|
||||
|
||||
static struct snd_card *snd_interwave_card_new(int dev)
|
||||
static int snd_interwave_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
struct snd_interwave *iwcard;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_interwave));
|
||||
if (card == NULL)
|
||||
return NULL;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_interwave), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
iwcard = card->private_data;
|
||||
iwcard->card = card;
|
||||
iwcard->irq = -1;
|
||||
card->private_free = snd_interwave_free;
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
|
||||
@ -778,9 +780,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_interwave_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_interwave_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
snd_card_set_dev(card, devptr);
|
||||
if ((err = snd_interwave_probe(card, dev)) < 0) {
|
||||
@ -876,9 +878,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_interwave_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_interwave_card_new(dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -617,21 +617,24 @@ static void snd_opl3sa2_free(struct snd_card *card)
|
||||
release_and_free_resource(chip->res_port);
|
||||
}
|
||||
|
||||
static struct snd_card *snd_opl3sa2_card_new(int dev)
|
||||
static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
struct snd_opl3sa2 *chip;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_opl3sa2));
|
||||
if (card == NULL)
|
||||
return NULL;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_opl3sa2), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
strcpy(card->driver, "OPL3SA2");
|
||||
strcpy(card->shortname, "Yamaha OPL3-SA2");
|
||||
chip = card->private_data;
|
||||
spin_lock_init(&chip->reg_lock);
|
||||
chip->irq = -1;
|
||||
card->private_free = snd_opl3sa2_free;
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev)
|
||||
@ -723,9 +726,9 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_opl3sa2_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_opl3sa2_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
@ -789,9 +792,9 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_opl3sa2_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_opl3sa2_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
@ -870,9 +873,9 @@ static int __devinit snd_opl3sa2_isa_probe(struct device *pdev,
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_opl3sa2_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_opl3sa2_card_new(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);
|
||||
|
@ -1228,9 +1228,10 @@ static int __devinit snd_miro_probe(struct device *devptr, unsigned int n)
|
||||
struct snd_pcm *pcm;
|
||||
struct snd_rawmidi *rmidi;
|
||||
|
||||
if (!(card = snd_card_new(index, id, THIS_MODULE,
|
||||
sizeof(struct snd_miro))))
|
||||
return -ENOMEM;
|
||||
error = snd_card_create(index, id, THIS_MODULE,
|
||||
sizeof(struct snd_miro), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
card->private_free = snd_card_miro_free;
|
||||
miro = card->private_data;
|
||||
|
@ -830,15 +830,18 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card)
|
||||
return snd_card_register(card);
|
||||
}
|
||||
|
||||
static struct snd_card *snd_opti9xx_card_new(void)
|
||||
static int snd_opti9xx_card_new(struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index, id, THIS_MODULE, sizeof(struct snd_opti9xx));
|
||||
if (! card)
|
||||
return NULL;
|
||||
err = snd_card_create(index, id, THIS_MODULE,
|
||||
sizeof(struct snd_opti9xx), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_card_opti9xx_free;
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit snd_opti9xx_isa_match(struct device *devptr,
|
||||
@ -903,9 +906,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
|
||||
}
|
||||
#endif
|
||||
|
||||
card = snd_opti9xx_card_new();
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
error = snd_opti9xx_card_new(&card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) {
|
||||
snd_card_free(card);
|
||||
@ -950,9 +953,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
|
||||
return -EBUSY;
|
||||
if (! isapnp)
|
||||
return -ENODEV;
|
||||
card = snd_opti9xx_card_new();
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
error = snd_opti9xx_card_new(&card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
chip = card->private_data;
|
||||
|
||||
hw = snd_card_opti9xx_pnp(chip, pcard, pid);
|
||||
|
@ -108,9 +108,10 @@ static int __devinit snd_card_es968_probe(int dev,
|
||||
struct snd_card *card;
|
||||
struct snd_card_es968 *acard;
|
||||
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_es968))) == NULL)
|
||||
return -ENOMEM;
|
||||
error = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_es968), &card);
|
||||
if (error < 0)
|
||||
return error;
|
||||
acard = card->private_data;
|
||||
if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) {
|
||||
snd_card_free(card);
|
||||
|
@ -324,14 +324,18 @@ static void snd_sb16_free(struct snd_card *card)
|
||||
#define is_isapnp_selected(dev) 0
|
||||
#endif
|
||||
|
||||
static struct snd_card *snd_sb16_card_new(int dev)
|
||||
static int snd_sb16_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_sb16));
|
||||
if (card == NULL)
|
||||
return NULL;
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_card_sb16), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_sb16_free;
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit snd_sb16_probe(struct snd_card *card, int dev)
|
||||
@ -489,9 +493,9 @@ static int __devinit snd_sb16_isa_probe1(int dev, struct device *pdev)
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_sb16_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_sb16_card_new(dev, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
acard = card->private_data;
|
||||
/* non-PnP FM port address is hardwired with base port address */
|
||||
@ -610,9 +614,9 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
|
||||
for ( ; dev < SNDRV_CARDS; dev++) {
|
||||
if (!enable[dev] || !isapnp[dev])
|
||||
continue;
|
||||
card = snd_sb16_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_sb16_card_new(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) {
|
||||
|
@ -103,10 +103,10 @@ static int __devinit snd_sb8_probe(struct device *pdev, unsigned int dev)
|
||||
struct snd_opl3 *opl3;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_sb8));
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_sb8), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
acard = card->private_data;
|
||||
card->private_free = snd_sb8_free;
|
||||
|
||||
|
@ -489,9 +489,9 @@ static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev)
|
||||
char __iomem *vmss_port;
|
||||
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
if (xirq == SNDRV_AUTO_IRQ) {
|
||||
xirq = snd_legacy_find_free_irq(possible_irqs);
|
||||
|
@ -243,9 +243,9 @@ static int __devinit snd_sgalaxy_probe(struct device *devptr, unsigned int dev)
|
||||
struct snd_card *card;
|
||||
struct snd_wss *chip;
|
||||
|
||||
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;
|
||||
|
||||
xirq = irq[dev];
|
||||
if (xirq == SNDRV_AUTO_IRQ) {
|
||||
|
@ -1357,10 +1357,10 @@ static int __devinit snd_sscape_probe(struct device *pdev, unsigned int dev)
|
||||
struct soundscape *sscape;
|
||||
int ret;
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct soundscape));
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
ret = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct soundscape), &card);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
sscape = get_card_soundscape(card);
|
||||
sscape->type = SSCAPE;
|
||||
@ -1462,10 +1462,10 @@ static int __devinit sscape_pnp_detect(struct pnp_card_link *pcard,
|
||||
* Create a new ALSA sound card entry, in anticipation
|
||||
* of detecting our hardware ...
|
||||
*/
|
||||
card = snd_card_new(index[idx], id[idx], THIS_MODULE,
|
||||
sizeof(struct soundscape));
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
ret = snd_card_create(index[idx], id[idx], THIS_MODULE,
|
||||
sizeof(struct soundscape), &card);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
sscape = get_card_soundscape(card);
|
||||
|
||||
|
@ -338,15 +338,16 @@ snd_wavefront_free(struct snd_card *card)
|
||||
}
|
||||
}
|
||||
|
||||
static struct snd_card *snd_wavefront_card_new(int dev)
|
||||
static int snd_wavefront_card_new(int dev, struct snd_card **cardp)
|
||||
{
|
||||
struct snd_card *card;
|
||||
snd_wavefront_card_t *acard;
|
||||
int err;
|
||||
|
||||
card = snd_card_new (index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(snd_wavefront_card_t));
|
||||
if (card == NULL)
|
||||
return NULL;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(snd_wavefront_card_t), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
acard = card->private_data;
|
||||
acard->wavefront.irq = -1;
|
||||
@ -357,7 +358,8 @@ static struct snd_card *snd_wavefront_card_new(int dev)
|
||||
acard->wavefront.card = card;
|
||||
card->private_free = snd_wavefront_free;
|
||||
|
||||
return card;
|
||||
*cardp = card;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit
|
||||
@ -567,9 +569,9 @@ static int __devinit snd_wavefront_isa_probe(struct device *pdev,
|
||||
struct snd_card *card;
|
||||
int err;
|
||||
|
||||
card = snd_wavefront_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
err = snd_wavefront_card_new(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);
|
||||
@ -616,9 +618,9 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
|
||||
if (dev >= SNDRV_CARDS)
|
||||
return -ENODEV;
|
||||
|
||||
card = snd_wavefront_card_new(dev);
|
||||
if (! card)
|
||||
return -ENOMEM;
|
||||
res = snd_wavefront_card_new(dev, &card);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) {
|
||||
if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) {
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -995,10 +995,10 @@ snd_ad1889_probe(struct pci_dev *pci,
|
||||
}
|
||||
|
||||
/* (2) */
|
||||
card = snd_card_new(index[devno], id[devno], THIS_MODULE, 0);
|
||||
err = snd_card_create(index[devno], id[devno], THIS_MODULE, 0, &card);
|
||||
/* XXX REVISIT: we can probably allocate chip in this call */
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
strcpy(card->driver, "AD1889");
|
||||
strcpy(card->shortname, "Analog Devices AD1889");
|
||||
|
@ -2307,9 +2307,9 @@ static int __devinit snd_ali_probe(struct pci_dev *pci,
|
||||
|
||||
snd_ali_printk("probe ...\n");
|
||||
|
||||
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_ali_create(card, pci, pcm_channels, spdif, &codec);
|
||||
if (err < 0)
|
||||
|
@ -812,10 +812,10 @@ static int __devinit snd_als300_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
chip_type = pci_id->driver_data;
|
||||
|
||||
|
@ -889,12 +889,13 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
|
||||
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
|
||||
pci_set_master(pci);
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(*acard) /* private_data: acard */);
|
||||
if (card == NULL) {
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(*acard) /* private_data: acard */,
|
||||
&card);
|
||||
if (err < 0) {
|
||||
pci_release_regions(pci);
|
||||
pci_disable_device(pci);
|
||||
return -ENOMEM;
|
||||
return err;
|
||||
}
|
||||
|
||||
acard = card->private_data;
|
||||
|
@ -1645,9 +1645,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
|
||||
struct atiixp *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;
|
||||
|
||||
strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
|
||||
strcpy(card->shortname, "ATI IXP");
|
||||
|
@ -1288,9 +1288,9 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
|
||||
struct atiixp_modem *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;
|
||||
|
||||
strcpy(card->driver, "ATIIXP-MODEM");
|
||||
strcpy(card->shortname, "ATI IXP Modem");
|
||||
|
@ -250,9 +250,9 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
return -ENOENT;
|
||||
}
|
||||
// (2)
|
||||
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;
|
||||
|
||||
// (3)
|
||||
if ((err = snd_vortex_create(card, pci, &chip)) < 0) {
|
||||
|
@ -368,9 +368,9 @@ static int __devinit snd_aw2_probe(struct pci_dev *pci,
|
||||
}
|
||||
|
||||
/* (2) Create card instance */
|
||||
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;
|
||||
|
||||
/* (3) Create main component */
|
||||
err = snd_aw2_create(card, pci, &chip);
|
||||
|
@ -2216,9 +2216,9 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
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;
|
||||
|
||||
strcpy(card->driver, "AZF3328");
|
||||
strcpy(card->shortname, "Aztech AZF3328 (PCI168)");
|
||||
|
@ -888,9 +888,9 @@ static int __devinit snd_bt87x_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
err = snd_bt87x_create(card, pci, &chip);
|
||||
if (err < 0)
|
||||
|
@ -1707,9 +1707,9 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci,
|
||||
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_ca0106_create(dev, card, pci, &chip);
|
||||
if (err < 0)
|
||||
|
@ -3272,9 +3272,9 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
switch (pci->device) {
|
||||
case PCI_DEVICE_ID_CMEDIA_CM8738:
|
||||
|
@ -1925,9 +1925,9 @@ static int __devinit snd_cs4281_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
if ((err = snd_cs4281_create(card, pci, &chip, dual_codec[dev])) < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -88,9 +88,9 @@ static int __devinit snd_card_cs46xx_probe(struct pci_dev *pci,
|
||||
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;
|
||||
if ((err = snd_cs46xx_create(card, pci,
|
||||
external_amp[dev], thinkpad[dev],
|
||||
&chip)) < 0) {
|
||||
|
@ -258,10 +258,10 @@ static int __devinit snd_cs5530_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
|
||||
if (card == NULL)
|
||||
return -ENOMEM;
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
err = snd_cs5530_create(card, pci, &chip);
|
||||
if (err < 0) {
|
||||
|
@ -353,9 +353,9 @@ static int __devinit snd_cs5535audio_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0)
|
||||
goto probefail_out;
|
||||
|
@ -1997,9 +1997,9 @@ static int __devinit snd_echo_probe(struct pci_dev *pci,
|
||||
|
||||
DE_INIT(("Echoaudio driver starting...\n"));
|
||||
i = 0;
|
||||
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;
|
||||
|
||||
snd_card_set_dev(card, &pci->dev);
|
||||
|
||||
|
@ -114,9 +114,9 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
|
||||
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;
|
||||
if (max_buffer_size[dev] < 32)
|
||||
max_buffer_size[dev] = 32;
|
||||
else if (max_buffer_size[dev] > 1024)
|
||||
|
@ -1544,9 +1544,9 @@ static int __devinit snd_emu10k1x_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
if ((err = snd_emu10k1x_create(card, pci, &chip)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -2409,9 +2409,9 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
if ((err = snd_ensoniq_create(card, pci, &ensoniq)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -1799,9 +1799,9 @@ static int __devinit snd_es1938_probe(struct pci_dev *pci,
|
||||
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;
|
||||
for (idx = 0; idx < 5; idx++) {
|
||||
if (pci_resource_start(pci, idx) == 0 ||
|
||||
!(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
|
||||
|
@ -2645,9 +2645,9 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
if (total_bufsize[dev] < 128)
|
||||
total_bufsize[dev] = 128;
|
||||
|
@ -1468,9 +1468,9 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci,
|
||||
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;
|
||||
if ((err = snd_fm801_create(card, pci, tea575x_tuner[dev], &chip)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -2335,10 +2335,10 @@ static int __devinit azx_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
|
||||
if (!card) {
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR SFX "Error creating card!\n");
|
||||
return -ENOMEM;
|
||||
return err;
|
||||
}
|
||||
|
||||
err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
|
||||
|
@ -2648,9 +2648,9 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
strcpy(card->driver, "ICE1712");
|
||||
strcpy(card->shortname, "ICEnsemble ICE1712");
|
||||
|
@ -2456,9 +2456,9 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
strcpy(card->driver, "ICE1724");
|
||||
strcpy(card->shortname, "ICEnsemble ICE1724");
|
||||
|
@ -3058,9 +3058,9 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
|
||||
int err;
|
||||
struct shortname_table *name;
|
||||
|
||||
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 (spdif_aclink < 0)
|
||||
spdif_aclink = check_default_spdif_aclink(pci);
|
||||
|
@ -1269,9 +1269,9 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
|
||||
int err;
|
||||
struct shortname_table *name;
|
||||
|
||||
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;
|
||||
|
||||
strcpy(card->driver, "ICH-MODEM");
|
||||
strcpy(card->shortname, "Intel ICH");
|
||||
|
@ -2443,9 +2443,9 @@ snd_korg1212_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
if ((err = snd_korg1212_create(card, pci, &korg1212)) < 0) {
|
||||
snd_card_free(card);
|
||||
|
@ -2691,9 +2691,9 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
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;
|
||||
|
||||
switch (pci->device) {
|
||||
case PCI_DEVICE_ID_ESS_ALLEGRO:
|
||||
|
@ -1365,12 +1365,12 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
|
||||
else
|
||||
idx = index[dev] + i;
|
||||
snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i);
|
||||
card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
|
||||
err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card);
|
||||
|
||||
if (! card) {
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
|
||||
snd_mixart_free(mgr);
|
||||
return -ENOMEM;
|
||||
return err;
|
||||
}
|
||||
|
||||
strcpy(card->driver, CARD_NAME);
|
||||
|
@ -1668,9 +1668,9 @@ static int __devinit snd_nm256_probe(struct pci_dev *pci,
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
switch (pci->device) {
|
||||
case PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO:
|
||||
|
@ -459,10 +459,10 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
|
||||
struct oxygen *chip;
|
||||
int err;
|
||||
|
||||
card = snd_card_new(index, id, model->owner,
|
||||
sizeof *chip + model->model_data_size);
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index, id, model->owner,
|
||||
sizeof(*chip) + model->model_data_size, &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
chip = card->private_data;
|
||||
chip->card = card;
|
||||
|
@ -1510,12 +1510,12 @@ static int __devinit pcxhr_probe(struct pci_dev *pci,
|
||||
|
||||
snprintf(tmpid, sizeof(tmpid), "%s-%d",
|
||||
id[dev] ? id[dev] : card_name, i);
|
||||
card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
|
||||
err = snd_card_create(idx, tmpid, THIS_MODULE, 0, &card);
|
||||
|
||||
if (! card) {
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
|
||||
pcxhr_free(mgr);
|
||||
return -ENOMEM;
|
||||
return err;
|
||||
}
|
||||
|
||||
strcpy(card->driver, DRIVER_NAME);
|
||||
|
@ -2102,9 +2102,9 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
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;
|
||||
if ((err = snd_riptide_create(card, pci, &chip)) < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
|
@ -1941,9 +1941,10 @@ snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct rme32))) == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct rme32), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_rme32_card_free;
|
||||
rme32 = (struct rme32 *) card->private_data;
|
||||
rme32->card = card;
|
||||
|
@ -2348,9 +2348,10 @@ snd_rme96_probe(struct pci_dev *pci,
|
||||
dev++;
|
||||
return -ENOENT;
|
||||
}
|
||||
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct rme96))) == NULL)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct rme96), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
card->private_free = snd_rme96_card_free;
|
||||
rme96 = (struct rme96 *)card->private_data;
|
||||
rme96->card = card;
|
||||
|
@ -5158,8 +5158,10 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (!(card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct hdsp))))
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct hdsp), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
hdsp = (struct hdsp *) card->private_data;
|
||||
card->private_free = snd_hdsp_card_free;
|
||||
|
@ -4503,10 +4503,10 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev],
|
||||
THIS_MODULE, sizeof(struct hdspm));
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
err = snd_card_create(index[dev], id[dev],
|
||||
THIS_MODULE, sizeof(struct hdspm), &card);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
hdspm = card->private_data;
|
||||
card->private_free = snd_hdspm_card_free;
|
||||
|
@ -2594,11 +2594,11 @@ static int __devinit snd_rme9652_probe(struct pci_dev *pci,
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_rme9652));
|
||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||
sizeof(struct snd_rme9652), &card);
|
||||
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
rme9652 = (struct snd_rme9652 *) card->private_data;
|
||||
card->private_free = snd_rme9652_card_free;
|
||||
|
@ -1387,9 +1387,8 @@ static int __devinit snd_sis7019_probe(struct pci_dev *pci,
|
||||
if (!enable)
|
||||
goto error_out;
|
||||
|
||||
rc = -ENOMEM;
|
||||
card = snd_card_new(index, id, THIS_MODULE, sizeof(*sis));
|
||||
if (!card)
|
||||
rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card);
|
||||
if (rc < 0)
|
||||
goto error_out;
|
||||
|
||||
strcpy(card->driver, "SiS7019");
|
||||
|
@ -1423,9 +1423,9 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
|
||||
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;
|
||||
for (idx = 0; idx < 5; idx++) {
|
||||
if (pci_resource_start(pci, idx) == 0 ||
|
||||
!(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
|
||||
|
@ -89,9 +89,9 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
if ((err = snd_trident_create(card, pci,
|
||||
pcm_channels[dev],
|
||||
|
@ -2433,9 +2433,9 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
|
||||
unsigned int i;
|
||||
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;
|
||||
|
||||
card_type = pci_id->driver_data;
|
||||
switch (card_type) {
|
||||
|
@ -1167,9 +1167,9 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
|
||||
unsigned int i;
|
||||
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;
|
||||
|
||||
card_type = pci_id->driver_data;
|
||||
switch (card_type) {
|
||||
|
@ -204,9 +204,9 @@ static int __devinit snd_vx222_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
switch ((int)pci_id->driver_data) {
|
||||
case VX_PCI_VX222_OLD:
|
||||
|
@ -187,9 +187,9 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
|
||||
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;
|
||||
|
||||
switch (pci_id->device) {
|
||||
case 0x0004: str = "YMF724"; model = "DS-1"; break;
|
||||
|
@ -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 = {
|
||||
@ -112,20 +112,23 @@ 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);
|
||||
if (! pdacf)
|
||||
return -EIO;
|
||||
if (!pdacf) {
|
||||
snd_card_free(card);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops) < 0) {
|
||||
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops);
|
||||
if (err < 0) {
|
||||
kfree(pdacf);
|
||||
snd_card_free(card);
|
||||
return -ENODEV;
|
||||
return err;
|
||||
}
|
||||
|
||||
snd_card_set_dev(card, &handle_to_dev(link));
|
||||
|
@ -130,23 +130,26 @@ static struct snd_vx_hardware vxp440_hw = {
|
||||
/*
|
||||
* create vxpocket instance
|
||||
*/
|
||||
static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl,
|
||||
struct pcmcia_device *link)
|
||||
static int snd_vxpocket_new(struct snd_card *card, int ibl,
|
||||
struct pcmcia_device *link,
|
||||
struct snd_vxpocket **chip_ret)
|
||||
{
|
||||
struct vx_core *chip;
|
||||
struct snd_vxpocket *vxp;
|
||||
static struct snd_device_ops ops = {
|
||||
.dev_free = snd_vxpocket_dev_free,
|
||||
};
|
||||
int err;
|
||||
|
||||
chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops,
|
||||
sizeof(struct snd_vxpocket) - sizeof(struct vx_core));
|
||||
if (! chip)
|
||||
return NULL;
|
||||
if (!chip)
|
||||
return -ENOMEM;
|
||||
|
||||
if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops) < 0) {
|
||||
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
|
||||
if (err < 0) {
|
||||
kfree(chip);
|
||||
return NULL;
|
||||
return err;
|
||||
}
|
||||
chip->ibl.size = ibl;
|
||||
|
||||
@ -169,7 +172,8 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl,
|
||||
link->conf.ConfigIndex = 1;
|
||||
link->conf.Present = PRESENT_OPTION;
|
||||
|
||||
return vxp;
|
||||
*chip_ret = vxp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -292,7 +296,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++) {
|
||||
@ -307,16 +311,16 @@ 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);
|
||||
if (! vxp) {
|
||||
err = snd_vxpocket_new(card, ibl[i], p_dev, &vxp);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return -ENODEV;
|
||||
return err;
|
||||
}
|
||||
card->private_data = vxp;
|
||||
|
||||
|
@ -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;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user