diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-06 05:51:07 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-06 05:51:07 -0400 |
commit | 012e060c95e547eceea4a12c6f58592473bf4011 (patch) | |
tree | b57d3eafb50ce517577d2cf366c9ef0b4b286589 /sound/drivers | |
parent | 923f122573851d18a3832ca808269fa2d5046fb1 (diff) | |
parent | ed39f731ab2e77e58122232f6e27333331d7793d (diff) |
Merge branch 'master'
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 3b2bee19e2c0..efcb4eb2d1a0 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig | |||
@@ -29,6 +29,7 @@ config SND_DUMMY | |||
29 | tristate "Dummy (/dev/null) soundcard" | 29 | tristate "Dummy (/dev/null) soundcard" |
30 | depends on SND | 30 | depends on SND |
31 | select SND_PCM | 31 | select SND_PCM |
32 | select SND_GENERIC_DRIVER | ||
32 | help | 33 | help |
33 | Say Y here to include the dummy driver. This driver does | 34 | Say Y here to include the dummy driver. This driver does |
34 | nothing, but emulates various mixer controls and PCM devices. | 35 | nothing, but emulates various mixer controls and PCM devices. |
@@ -44,6 +45,7 @@ config SND_VIRMIDI | |||
44 | depends on SND_SEQUENCER | 45 | depends on SND_SEQUENCER |
45 | select SND_TIMER | 46 | select SND_TIMER |
46 | select SND_RAWMIDI | 47 | select SND_RAWMIDI |
48 | select SND_GENERIC_DRIVER | ||
47 | help | 49 | help |
48 | Say Y here to include the virtual MIDI driver. This driver | 50 | Say Y here to include the virtual MIDI driver. This driver |
49 | allows to connect applications using raw MIDI devices to | 51 | allows to connect applications using raw MIDI devices to |
@@ -59,6 +61,7 @@ config SND_MTPAV | |||
59 | depends on SND | 61 | depends on SND |
60 | select SND_TIMER | 62 | select SND_TIMER |
61 | select SND_RAWMIDI | 63 | select SND_RAWMIDI |
64 | select SND_GENERIC_DRIVER | ||
62 | help | 65 | help |
63 | To use a MOTU MidiTimePiece AV multiport MIDI adapter | 66 | To use a MOTU MidiTimePiece AV multiport MIDI adapter |
64 | connected to the parallel port, say Y here and make sure that | 67 | connected to the parallel port, say Y here and make sure that |
@@ -72,6 +75,7 @@ config SND_SERIAL_U16550 | |||
72 | depends on SND | 75 | depends on SND |
73 | select SND_TIMER | 76 | select SND_TIMER |
74 | select SND_RAWMIDI | 77 | select SND_RAWMIDI |
78 | select SND_GENERIC_DRIVER | ||
75 | help | 79 | help |
76 | To include support for MIDI serial port interfaces, say Y here | 80 | To include support for MIDI serial port interfaces, say Y here |
77 | and read <file:Documentation/sound/alsa/serial-u16550.txt>. | 81 | and read <file:Documentation/sound/alsa/serial-u16550.txt>. |
@@ -88,6 +92,7 @@ config SND_MPU401 | |||
88 | tristate "Generic MPU-401 UART driver" | 92 | tristate "Generic MPU-401 UART driver" |
89 | depends on SND | 93 | depends on SND |
90 | select SND_MPU401_UART | 94 | select SND_MPU401_UART |
95 | select SND_GENERIC_DRIVER | ||
91 | help | 96 | help |
92 | Say Y here to include support for MIDI ports compatible with | 97 | Say Y here to include support for MIDI ports compatible with |
93 | the Roland MPU-401 interface in UART mode. | 98 | the Roland MPU-401 interface in UART mode. |
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index a61640cf7ae7..64ef7f62851d 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) | |||
337 | snd_card_dummy_pcm_t *dpcm; | 337 | snd_card_dummy_pcm_t *dpcm; |
338 | int err; | 338 | int err; |
339 | 339 | ||
340 | dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); | 340 | dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); |
341 | if (dpcm == NULL) | 341 | if (dpcm == NULL) |
342 | return -ENOMEM; | 342 | return -ENOMEM; |
343 | init_timer(&dpcm->timer); | 343 | init_timer(&dpcm->timer); |
@@ -368,7 +368,7 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream) | |||
368 | snd_card_dummy_pcm_t *dpcm; | 368 | snd_card_dummy_pcm_t *dpcm; |
369 | int err; | 369 | int err; |
370 | 370 | ||
371 | dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); | 371 | dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); |
372 | if (dpcm == NULL) | 372 | if (dpcm == NULL) |
373 | return -ENOMEM; | 373 | return -ENOMEM; |
374 | init_timer(&dpcm->timer); | 374 | init_timer(&dpcm->timer); |
@@ -600,6 +600,10 @@ static int __init snd_card_dummy_probe(int dev) | |||
600 | strcpy(card->driver, "Dummy"); | 600 | strcpy(card->driver, "Dummy"); |
601 | strcpy(card->shortname, "Dummy"); | 601 | strcpy(card->shortname, "Dummy"); |
602 | sprintf(card->longname, "Dummy %i", dev + 1); | 602 | sprintf(card->longname, "Dummy %i", dev + 1); |
603 | |||
604 | if ((err = snd_card_set_generic_dev(card)) < 0) | ||
605 | goto __nodev; | ||
606 | |||
603 | if ((err = snd_card_register(card)) == 0) { | 607 | if ((err = snd_card_register(card)) == 0) { |
604 | snd_dummy_cards[dev] = card; | 608 | snd_dummy_cards[dev] = card; |
605 | return 0; | 609 | return 0; |
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index cb36ecb78697..54e2ff9b5ca1 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) | |||
77 | strcat(card->longname, "polled"); | 77 | strcat(card->longname, "polled"); |
78 | } | 78 | } |
79 | 79 | ||
80 | if (snd_mpu401_uart_new(card, 0, | 80 | if ((err = snd_mpu401_uart_new(card, 0, |
81 | MPU401_HW_MPU401, | 81 | MPU401_HW_MPU401, |
82 | port[dev], 0, | 82 | port[dev], 0, |
83 | irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) { | 83 | irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL)) < 0) { |
84 | printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); | 84 | printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); |
85 | snd_card_free(card); | 85 | goto _err; |
86 | return -ENODEV; | ||
87 | } | ||
88 | if ((err = snd_card_register(card)) < 0) { | ||
89 | snd_card_free(card); | ||
90 | return err; | ||
91 | } | 86 | } |
87 | |||
88 | if ((err = snd_card_set_generic_dev(card)) < 0) | ||
89 | goto _err; | ||
90 | |||
91 | if ((err = snd_card_register(card)) < 0) | ||
92 | goto _err; | ||
93 | |||
92 | *rcard = card; | 94 | *rcard = card; |
93 | return 0; | 95 | return 0; |
96 | |||
97 | _err: | ||
98 | snd_card_free(card); | ||
99 | return err; | ||
94 | } | 100 | } |
95 | 101 | ||
96 | static int __devinit snd_mpu401_probe(int dev) | 102 | 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 0f83c5241b6b..fe3f921ffbe3 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, | |||
463 | *rrawmidi = NULL; | 463 | *rrawmidi = NULL; |
464 | if ((err = snd_rawmidi_new(card, "MPU-401U", device, 1, 1, &rmidi)) < 0) | 464 | if ((err = snd_rawmidi_new(card, "MPU-401U", device, 1, 1, &rmidi)) < 0) |
465 | return err; | 465 | return err; |
466 | mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL); | 466 | mpu = kzalloc(sizeof(*mpu), GFP_KERNEL); |
467 | if (mpu == NULL) { | 467 | if (mpu == NULL) { |
468 | snd_device_free(card, rmidi); | 468 | snd_device_free(card, rmidi); |
469 | return -ENOMEM; | 469 | return -ENOMEM; |
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index 1280a57c49eb..3a25c89d2983 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c | |||
@@ -688,7 +688,7 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard) | |||
688 | 688 | ||
689 | static mtpav_t *new_mtpav(void) | 689 | static mtpav_t *new_mtpav(void) |
690 | { | 690 | { |
691 | mtpav_t *ncrd = kcalloc(1, sizeof(*ncrd), GFP_KERNEL); | 691 | mtpav_t *ncrd = kzalloc(sizeof(*ncrd), GFP_KERNEL); |
692 | if (ncrd != NULL) { | 692 | if (ncrd != NULL) { |
693 | spin_lock_init(&ncrd->spinlock); | 693 | spin_lock_init(&ncrd->spinlock); |
694 | 694 | ||
@@ -757,6 +757,9 @@ static int __init alsa_card_mtpav_init(void) | |||
757 | if (err < 0) | 757 | if (err < 0) |
758 | goto __error; | 758 | goto __error; |
759 | 759 | ||
760 | if ((err = snd_card_set_generic_dev(mtp_card->card)) < 0) | ||
761 | goto __error; | ||
762 | |||
760 | err = snd_card_register(mtp_card->card); // don't snd_card_register until AFTER all cards reources done! | 763 | err = snd_card_register(mtp_card->card); // don't snd_card_register until AFTER all cards reources done! |
761 | 764 | ||
762 | //printk("snd_card_register returned %d\n", err); | 765 | //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 c313e5205cb8..1f84d78260de 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, | |||
354 | int err; | 354 | int err; |
355 | 355 | ||
356 | *ropl3 = NULL; | 356 | *ropl3 = NULL; |
357 | opl3 = kcalloc(1, sizeof(*opl3), GFP_KERNEL); | 357 | opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL); |
358 | if (opl3 == NULL) | 358 | if (opl3 == NULL) |
359 | return -ENOMEM; | 359 | return -ENOMEM; |
360 | 360 | ||
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c index 33da334ae981..21a2b409d6d3 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, | |||
241 | } | 241 | } |
242 | 242 | ||
243 | size = sizeof(*put) + sizeof(fm_xinstrument_t); | 243 | size = sizeof(*put) + sizeof(fm_xinstrument_t); |
244 | put = kcalloc(1, size, GFP_KERNEL); | 244 | put = kzalloc(size, GFP_KERNEL); |
245 | if (put == NULL) | 245 | if (put == NULL) |
246 | return -ENOMEM; | 246 | return -ENOMEM; |
247 | /* build header */ | 247 | /* build header */ |
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 8261464dade8..380c2c704c54 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, | |||
204 | if (ropl4) | 204 | if (ropl4) |
205 | *ropl4 = NULL; | 205 | *ropl4 = NULL; |
206 | 206 | ||
207 | opl4 = kcalloc(1, sizeof(*opl4), GFP_KERNEL); | 207 | opl4 = kzalloc(sizeof(*opl4), GFP_KERNEL); |
208 | if (!opl4) | 208 | if (!opl4) |
209 | return -ENOMEM; | 209 | return -ENOMEM; |
210 | 210 | ||
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 986df35fb829..416172ea1f47 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, | |||
779 | int err; | 779 | int err; |
780 | 780 | ||
781 | 781 | ||
782 | if ((uart = kcalloc(1, sizeof(*uart), GFP_KERNEL)) == NULL) | 782 | if ((uart = kzalloc(sizeof(*uart), GFP_KERNEL)) == NULL) |
783 | return -ENOMEM; | 783 | return -ENOMEM; |
784 | uart->adaptor = adaptor; | 784 | uart->adaptor = adaptor; |
785 | uart->card = card; | 785 | uart->card = card; |
@@ -928,15 +928,11 @@ static int __init snd_serial_probe(int dev) | |||
928 | base[dev], | 928 | base[dev], |
929 | adaptor[dev], | 929 | adaptor[dev], |
930 | droponfull[dev], | 930 | droponfull[dev], |
931 | &uart)) < 0) { | 931 | &uart)) < 0) |
932 | snd_card_free(card); | 932 | goto _err; |
933 | return err; | ||
934 | } | ||
935 | 933 | ||
936 | if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) { | 934 | if ((err = snd_uart16550_rmidi(uart, 0, outs[dev], ins[dev], &uart->rmidi)) < 0) |
937 | snd_card_free(card); | 935 | goto _err; |
938 | return err; | ||
939 | } | ||
940 | 936 | ||
941 | sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d", | 937 | sprintf(card->longname, "%s at 0x%lx, irq %d speed %d div %d outs %d ins %d adaptor %s droponfull %d", |
942 | card->shortname, | 938 | card->shortname, |
@@ -949,12 +945,18 @@ static int __init snd_serial_probe(int dev) | |||
949 | adaptor_names[uart->adaptor], | 945 | adaptor_names[uart->adaptor], |
950 | uart->drop_on_full); | 946 | uart->drop_on_full); |
951 | 947 | ||
952 | if ((err = snd_card_register(card)) < 0) { | 948 | if ((err = snd_card_set_generic_dev(card)) < 0) |
953 | snd_card_free(card); | 949 | goto _err; |
954 | return err; | 950 | |
955 | } | 951 | if ((err = snd_card_register(card)) < 0) |
952 | goto _err; | ||
953 | |||
956 | snd_serial_cards[dev] = card; | 954 | snd_serial_cards[dev] = card; |
957 | return 0; | 955 | return 0; |
956 | |||
957 | _err: | ||
958 | snd_card_free(card); | ||
959 | return err; | ||
958 | } | 960 | } |
959 | 961 | ||
960 | static int __init alsa_card_serial_init(void) | 962 | static int __init alsa_card_serial_init(void) |
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index 5937711e9505..af12185ab8a2 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c | |||
@@ -116,6 +116,10 @@ static int __init snd_card_virmidi_probe(int dev) | |||
116 | strcpy(card->driver, "VirMIDI"); | 116 | strcpy(card->driver, "VirMIDI"); |
117 | strcpy(card->shortname, "VirMIDI"); | 117 | strcpy(card->shortname, "VirMIDI"); |
118 | sprintf(card->longname, "Virtual MIDI Card %i", dev + 1); | 118 | sprintf(card->longname, "Virtual MIDI Card %i", dev + 1); |
119 | |||
120 | if ((err = snd_card_set_generic_dev(card)) < 0) | ||
121 | goto __nodev; | ||
122 | |||
119 | if ((err = snd_card_register(card)) == 0) { | 123 | if ((err = snd_card_register(card)) == 0) { |
120 | snd_virmidi_cards[dev] = card; | 124 | snd_virmidi_cards[dev] = card; |
121 | return 0; | 125 | return 0; |
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index c6fa5afa3e9a..4697b1d75cbb 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, | |||
782 | 782 | ||
783 | snd_assert(card && hw && ops, return NULL); | 783 | snd_assert(card && hw && ops, return NULL); |
784 | 784 | ||
785 | chip = kcalloc(1, sizeof(*chip) + extra_size, GFP_KERNEL); | 785 | chip = kzalloc(sizeof(*chip) + extra_size, GFP_KERNEL); |
786 | if (! chip) { | 786 | if (! chip) { |
787 | snd_printk(KERN_ERR "vx_core: no memory\n"); | 787 | snd_printk(KERN_ERR "vx_core: no memory\n"); |
788 | return NULL; | 788 | return NULL; |
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index d4becf44e247..c2312d912fc7 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, | |||
473 | return err; | 473 | return err; |
474 | 474 | ||
475 | /* initialize the pipe record */ | 475 | /* initialize the pipe record */ |
476 | pipe = kcalloc(1, sizeof(*pipe), GFP_KERNEL); | 476 | pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); |
477 | if (! pipe) { | 477 | if (! pipe) { |
478 | /* release the pipe */ | 478 | /* release the pipe */ |
479 | vx_init_rmh(&rmh, CMD_FREE_PIPE); | 479 | vx_init_rmh(&rmh, CMD_FREE_PIPE); |