diff options
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/Kconfig | 5 | ||||
-rw-r--r-- | sound/drivers/dummy.c | 8 | ||||
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 26 | ||||
-rw-r--r-- | sound/drivers/mpu401/mpu401_uart.c | 2 | ||||
-rw-r--r-- | sound/drivers/mtpav.c | 5 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_lib.c | 2 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_oss.c | 2 | ||||
-rw-r--r-- | sound/drivers/opl4/opl4_lib.c | 2 | ||||
-rw-r--r-- | sound/drivers/serial-u16550.c | 28 | ||||
-rw-r--r-- | sound/drivers/virmidi.c | 4 | ||||
-rw-r--r-- | sound/drivers/vx/vx_core.c | 2 | ||||
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 2 |
12 files changed, 56 insertions, 32 deletions
diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig index 3b2bee19e2c..efcb4eb2d1a 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig @@ -29,6 +29,7 @@ config SND_DUMMY tristate "Dummy (/dev/null) soundcard" depends on SND select SND_PCM + select SND_GENERIC_DRIVER help Say Y here to include the dummy driver. This driver does nothing, but emulates various mixer controls and PCM devices. @@ -44,6 +45,7 @@ config SND_VIRMIDI depends on SND_SEQUENCER select SND_TIMER select SND_RAWMIDI + select SND_GENERIC_DRIVER help Say Y here to include the virtual MIDI driver. This driver allows to connect applications using raw MIDI devices to @@ -59,6 +61,7 @@ config SND_MTPAV depends on SND select SND_TIMER select SND_RAWMIDI + select SND_GENERIC_DRIVER help To use a MOTU MidiTimePiece AV multiport MIDI adapter connected to the parallel port, say Y here and make sure that @@ -72,6 +75,7 @@ config SND_SERIAL_U16550 depends on SND select SND_TIMER select SND_RAWMIDI + select SND_GENERIC_DRIVER help To include support for MIDI serial port interfaces, say Y here and read <file:Documentation/sound/alsa/serial-u16550.txt>. @@ -88,6 +92,7 @@ config SND_MPU401 tristate "Generic MPU-401 UART driver" depends on SND select SND_MPU401_UART + select SND_GENERIC_DRIVER help Say Y here to include support for MIDI ports compatible with the Roland MPU-401 interface in UART mode. diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index a61640cf7ae..64ef7f62851 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -337,7 +337,7 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream) snd_card_dummy_pcm_t *dpcm; int err; - dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); + dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); if (dpcm == NULL) return -ENOMEM; init_timer(&dpcm->timer); @@ -368,7 +368,7 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream) snd_card_dummy_pcm_t *dpcm; int err; - dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); + dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); if (dpcm == NULL) return -ENOMEM; init_timer(&dpcm->timer); @@ -600,6 +600,10 @@ static int __init snd_card_dummy_probe(int dev) strcpy(card->driver, "Dummy"); strcpy(card->shortname, "Dummy"); sprintf(card->longname, "Dummy %i", dev + 1); + + if ((err = snd_card_set_generic_dev(card)) < 0) + goto __nodev; + if ((err = snd_card_register(card)) == 0) { snd_dummy_cards[dev] = card; return 0; diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index cb36ecb7869..54e2ff9b5ca 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c @@ -77,20 +77,26 @@ static int snd_mpu401_create(int dev, snd_card_t **rcard) strcat(card->longname, "polled"); } - if (snd_mpu401_uart_new(card, 0, - MPU401_HW_MPU401, - port[dev], 0, - irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) { + if ((err = snd_mpu401_uart_new(card, 0, + MPU401_HW_MPU401, + port[dev], 0, + irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL)) < 0) { printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); - snd_card_free(card); - return -ENODEV; - } - if ((err = snd_card_register(card)) < 0) { - snd_card_free(card); - return err; + goto _err; } + + if ((err = snd_card_set_generic_dev(card)) < 0) + goto _err; + + if ((err = snd_card_register(card)) < 0) + goto _err; + *rcard = card; return 0; + + _err: + snd_card_free(card); + return err; } static int __devinit snd_mpu401_probe(int dev) diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index 0f83c5241b6..fe3f921ffbe 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c @@ -463,7 +463,7 @@ int snd_mpu401_uart_new(snd_card_t * card, int device, *rrawmidi = NULL; if ((err = snd_rawmidi_new(card, "MPU-401U", device, 1, 1, &rmidi)) < 0) return err; - mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL); + mpu = kzalloc(sizeof(*mpu), GFP_KERNEL); if (mpu == NULL) { snd_device_free(card, rmidi); return -ENOMEM; diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index 1280a57c49e..3a25c89d298 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c @@ -688,7 +688,7 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard) static mtpav_t *new_mtpav(void) { - mtpav_t *ncrd = kcalloc(1, sizeof(*ncrd), GFP_KERNEL); + mtpav_t *ncrd = kzalloc(sizeof(*ncrd), GFP_KERNEL); if (ncrd != NULL) { spin_lock_init(&ncrd->spinlock); @@ -757,6 +757,9 @@ static int __init alsa_card_mtpav_init(void) if (err < 0) goto __error; + if ((err = snd_card_set_generic_dev(mtp_card->card)) < 0) + goto __error; + err = snd_card_register(mtp_card->card); // don't snd_card_register until AFTER all cards reources done! //printk("snd_card_register returned %d\n", err); diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index c313e5205cb..1f84d78260d 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -354,7 +354,7 @@ int snd_opl3_new(snd_card_t *card, int err; *ropl3 = NULL; - opl3 = kcalloc(1, sizeof(*opl3), GFP_KERNEL); + opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL); if (opl3 == NULL) return -ENOMEM; diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c index 33da334ae98..21a2b409d6d 100644 --- a/sound/drivers/opl3/opl3_oss.c +++ b/sound/drivers/opl3/opl3_oss.c @@ -241,7 +241,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, } size = sizeof(*put) + sizeof(fm_xinstrument_t); - put = kcalloc(1, size, GFP_KERNEL); + put = kzalloc(size, GFP_KERNEL); if (put == NULL) return -ENOMEM; /* build header */ diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 8261464dade..380c2c704c5 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -204,7 +204,7 @@ int snd_opl4_create(snd_card_t *card, if (ropl4) *ropl4 = NULL; - opl4 = kcalloc(1, sizeof(*opl4), GFP_KERNEL); + opl4 = kzalloc(sizeof(*opl4), GFP_KERNEL); if (!opl4) return -ENOMEM; diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 986df35fb82..416172ea1f4 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -779,7 +779,7 @@ static int __init snd_uart16550_create(snd_card_t * card, int err; - if ((uart = kcalloc(1, sizeof(*uart), GFP_KERNEL)) == NULL) + if ((uart = kzalloc(sizeof(*uart), GFP_KERNEL)) == NULL) return -ENOMEM; uart->adaptor = adaptor; uart->card = card; @@ -928,15 +928,11 @@ static int __init snd_serial_probe(int dev) base[dev], adaptor[dev], droponfull[dev], - &uart)) < 0) { - snd_card_free(card); - return err; - } + &uart)) < 0) + goto _err; - if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) { - snd_card_free(card); - return err; - } + if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) + goto _err; sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d", card->shortname, @@ -949,12 +945,18 @@ static int __init snd_serial_probe(int dev) adaptor_names[uart->adaptor], uart->drop_on_full); - if ((err = snd_card_register(card)) < 0) { - snd_card_free(card); - return err; - } + if ((err = snd_card_set_generic_dev(card)) < 0) + goto _err; + + if ((err = snd_card_register(card)) < 0) + goto _err; + snd_serial_cards[dev] = card; return 0; + + _err: + snd_card_free(card); + return err; } static int __init alsa_card_serial_init(void) diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 5937711e950..af12185ab8a 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c @@ -116,6 +116,10 @@ static int __init snd_card_virmidi_probe(int dev) strcpy(card->driver, "VirMIDI"); strcpy(card->shortname, "VirMIDI"); sprintf(card->longname, "Virtual MIDI Card %i", dev + 1); + + if ((err = snd_card_set_generic_dev(card)) < 0) + goto __nodev; + if ((err = snd_card_register(card)) == 0) { snd_virmidi_cards[dev] = card; return 0; diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index c6fa5afa3e9..4697b1d75cb 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -782,7 +782,7 @@ vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw, snd_assert(card && hw && ops, return NULL); - chip = kcalloc(1, sizeof(*chip) + extra_size, GFP_KERNEL); + chip = kzalloc(sizeof(*chip) + extra_size, GFP_KERNEL); if (! chip) { snd_printk(KERN_ERR "vx_core: no memory\n"); return NULL; diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index d4becf44e24..c2312d912fc 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -473,7 +473,7 @@ static int vx_alloc_pipe(vx_core_t *chip, int capture, return err; /* initialize the pipe record */ - pipe = kcalloc(1, sizeof(*pipe), GFP_KERNEL); + pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); if (! pipe) { /* release the pipe */ vx_init_rmh(&rmh, CMD_FREE_PIPE); |