aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-toonie.c17
-rw-r--r--sound/aoa/core/snd-aoa-gpio-feature.c7
-rw-r--r--sound/aoa/core/snd-aoa-gpio-pmf.c2
-rw-r--r--sound/core/oss/mixer_oss.c3
-rw-r--r--sound/core/oss/pcm_oss.c2
-rw-r--r--sound/core/seq/seq_device.c3
-rw-r--r--sound/core/sgbuf.c9
-rw-r--r--sound/drivers/vx/vx_pcm.c7
-rw-r--r--sound/oss/Kconfig6
-rw-r--r--sound/pci/Kconfig70
-rw-r--r--sound/pci/echoaudio/echoaudio.c4
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c11
-rw-r--r--sound/pci/emu10k1/irq.c6
-rw-r--r--sound/ppc/awacs.c3
-rw-r--r--sound/ppc/daca.c3
-rw-r--r--sound/ppc/keywest.c3
-rw-r--r--sound/ppc/powermac.c13
-rw-r--r--sound/ppc/tumbler.c3
-rw-r--r--sound/usb/usbaudio.c6
19 files changed, 94 insertions, 84 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-toonie.c b/sound/aoa/codecs/snd-aoa-codec-toonie.c
index bcc555647e79..3c7d1d8a9a6f 100644
--- a/sound/aoa/codecs/snd-aoa-codec-toonie.c
+++ b/sound/aoa/codecs/snd-aoa-codec-toonie.c
@@ -51,6 +51,13 @@ static struct transfer_info toonie_transfers[] = {
51 {} 51 {}
52}; 52};
53 53
54static int toonie_usable(struct codec_info_item *cii,
55 struct transfer_info *ti,
56 struct transfer_info *out)
57{
58 return 1;
59}
60
54#ifdef CONFIG_PM 61#ifdef CONFIG_PM
55static int toonie_suspend(struct codec_info_item *cii, pm_message_t state) 62static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
56{ 63{
@@ -69,6 +76,7 @@ static struct codec_info toonie_codec_info = {
69 .sysclock_factor = 256, 76 .sysclock_factor = 256,
70 .bus_factor = 64, 77 .bus_factor = 64,
71 .owner = THIS_MODULE, 78 .owner = THIS_MODULE,
79 .usable = toonie_usable,
72#ifdef CONFIG_PM 80#ifdef CONFIG_PM
73 .suspend = toonie_suspend, 81 .suspend = toonie_suspend,
74 .resume = toonie_resume, 82 .resume = toonie_resume,
@@ -79,19 +87,20 @@ static int toonie_init_codec(struct aoa_codec *codec)
79{ 87{
80 struct toonie *toonie = codec_to_toonie(codec); 88 struct toonie *toonie = codec_to_toonie(codec);
81 89
90 /* nothing connected? what a joke! */
91 if (toonie->codec.connected != 1)
92 return -ENOTCONN;
93
82 if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) { 94 if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
83 printk(KERN_ERR PFX "failed to create toonie snd device!\n"); 95 printk(KERN_ERR PFX "failed to create toonie snd device!\n");
84 return -ENODEV; 96 return -ENODEV;
85 } 97 }
86 98
87 /* nothing connected? what a joke! */
88 if (toonie->codec.connected != 1)
89 return -ENOTCONN;
90
91 if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev, 99 if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
92 aoa_get_card(), 100 aoa_get_card(),
93 &toonie_codec_info, toonie)) { 101 &toonie_codec_info, toonie)) {
94 printk(KERN_ERR PFX "error creating toonie pcm\n"); 102 printk(KERN_ERR PFX "error creating toonie pcm\n");
103 snd_device_free(aoa_get_card(), toonie);
95 return -ENODEV; 104 return -ENODEV;
96 } 105 }
97 106
diff --git a/sound/aoa/core/snd-aoa-gpio-feature.c b/sound/aoa/core/snd-aoa-gpio-feature.c
index 7ae0c0bdfad8..f69d33357a28 100644
--- a/sound/aoa/core/snd-aoa-gpio-feature.c
+++ b/sound/aoa/core/snd-aoa-gpio-feature.c
@@ -112,7 +112,10 @@ static struct device_node *get_gpio(char *name,
112 112
113static void get_irq(struct device_node * np, int *irqptr) 113static void get_irq(struct device_node * np, int *irqptr)
114{ 114{
115 *irqptr = irq_of_parse_and_map(np, 0); 115 if (np)
116 *irqptr = irq_of_parse_and_map(np, 0);
117 else
118 *irqptr = NO_IRQ;
116} 119}
117 120
118/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */ 121/* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
@@ -322,7 +325,7 @@ static int ftr_set_notify(struct gpio_runtime *rt,
322 return -EINVAL; 325 return -EINVAL;
323 } 326 }
324 327
325 if (irq == -1) 328 if (irq == NO_IRQ)
326 return -ENODEV; 329 return -ENODEV;
327 330
328 mutex_lock(&notif->mutex); 331 mutex_lock(&notif->mutex);
diff --git a/sound/aoa/core/snd-aoa-gpio-pmf.c b/sound/aoa/core/snd-aoa-gpio-pmf.c
index 3d57fd1aec4b..2836c3218391 100644
--- a/sound/aoa/core/snd-aoa-gpio-pmf.c
+++ b/sound/aoa/core/snd-aoa-gpio-pmf.c
@@ -18,7 +18,7 @@ static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
18 \ 18 \
19 if (unlikely(!rt)) return; \ 19 if (unlikely(!rt)) return; \
20 rc = pmf_call_function(rt->node, #name "-mute", &args); \ 20 rc = pmf_call_function(rt->node, #name "-mute", &args); \
21 if (rc) \ 21 if (rc && rc != -ENODEV) \
22 printk(KERN_WARNING "pmf_gpio_set_" #name \ 22 printk(KERN_WARNING "pmf_gpio_set_" #name \
23 " failed, rc: %d\n", rc); \ 23 " failed, rc: %d\n", rc); \
24 rt->implementation_private &= ~(1<<bit); \ 24 rt->implementation_private &= ~(1<<bit); \
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 71b5080fa66d..75a9505c7445 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -988,13 +988,12 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
988 if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) { 988 if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
989 struct snd_ctl_elem_info *uinfo; 989 struct snd_ctl_elem_info *uinfo;
990 990
991 uinfo = kmalloc(sizeof(*uinfo), GFP_KERNEL); 991 uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
992 if (! uinfo) { 992 if (! uinfo) {
993 up_read(&mixer->card->controls_rwsem); 993 up_read(&mixer->card->controls_rwsem);
994 return -ENOMEM; 994 return -ENOMEM;
995 } 995 }
996 996
997 memset(uinfo, 0, sizeof(*uinfo));
998 if (kctl->info(kctl, uinfo)) { 997 if (kctl->info(kctl, uinfo)) {
999 up_read(&mixer->card->controls_rwsem); 998 up_read(&mixer->card->controls_rwsem);
1000 return 0; 999 return 0;
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index f5ff4f4a16ee..472fce0ee0e8 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2228,6 +2228,8 @@ static int snd_pcm_oss_open_file(struct file *file,
2228 for (idx = 0; idx < 2; idx++) { 2228 for (idx = 0; idx < 2; idx++) {
2229 if (setup[idx].disable) 2229 if (setup[idx].disable)
2230 continue; 2230 continue;
2231 if (! pcm->streams[idx].substream_count)
2232 continue; /* no matching substream */
2231 if (idx == SNDRV_PCM_STREAM_PLAYBACK) { 2233 if (idx == SNDRV_PCM_STREAM_PLAYBACK) {
2232 if (! (f_mode & FMODE_WRITE)) 2234 if (! (f_mode & FMODE_WRITE))
2233 continue; 2235 continue;
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index 4260de90f36f..102ff548ce69 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -372,10 +372,9 @@ static struct ops_list * create_driver(char *id)
372{ 372{
373 struct ops_list *ops; 373 struct ops_list *ops;
374 374
375 ops = kmalloc(sizeof(*ops), GFP_KERNEL); 375 ops = kzalloc(sizeof(*ops), GFP_KERNEL);
376 if (ops == NULL) 376 if (ops == NULL)
377 return ops; 377 return ops;
378 memset(ops, 0, sizeof(*ops));
379 378
380 /* set up driver entry */ 379 /* set up driver entry */
381 strlcpy(ops->id, id, sizeof(ops->id)); 380 strlcpy(ops->id, id, sizeof(ops->id));
diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c
index 6e4d4ab34632..c30669f14ac0 100644
--- a/sound/core/sgbuf.c
+++ b/sound/core/sgbuf.c
@@ -68,21 +68,18 @@ void *snd_malloc_sgbuf_pages(struct device *device,
68 68
69 dmab->area = NULL; 69 dmab->area = NULL;
70 dmab->addr = 0; 70 dmab->addr = 0;
71 dmab->private_data = sgbuf = kmalloc(sizeof(*sgbuf), GFP_KERNEL); 71 dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL);
72 if (! sgbuf) 72 if (! sgbuf)
73 return NULL; 73 return NULL;
74 memset(sgbuf, 0, sizeof(*sgbuf));
75 sgbuf->dev = device; 74 sgbuf->dev = device;
76 pages = snd_sgbuf_aligned_pages(size); 75 pages = snd_sgbuf_aligned_pages(size);
77 sgbuf->tblsize = sgbuf_align_table(pages); 76 sgbuf->tblsize = sgbuf_align_table(pages);
78 sgbuf->table = kmalloc(sizeof(*sgbuf->table) * sgbuf->tblsize, GFP_KERNEL); 77 sgbuf->table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->table), GFP_KERNEL);
79 if (! sgbuf->table) 78 if (! sgbuf->table)
80 goto _failed; 79 goto _failed;
81 memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize); 80 sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL);
82 sgbuf->page_table = kmalloc(sizeof(*sgbuf->page_table) * sgbuf->tblsize, GFP_KERNEL);
83 if (! sgbuf->page_table) 81 if (! sgbuf->page_table)
84 goto _failed; 82 goto _failed;
85 memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize);
86 83
87 /* allocate each page */ 84 /* allocate each page */
88 for (i = 0; i < pages; i++) { 85 for (i = 0; i < pages; i++) {
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index c4af84995d05..7e65a103fbb2 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -1252,18 +1252,15 @@ static int vx_init_audio_io(struct vx_core *chip)
1252 chip->audio_info = rmh.Stat[1]; 1252 chip->audio_info = rmh.Stat[1];
1253 1253
1254 /* allocate pipes */ 1254 /* allocate pipes */
1255 chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); 1255 chip->playback_pipes = kcalloc(chip->audio_outs, sizeof(struct vx_pipe *), GFP_KERNEL);
1256 if (!chip->playback_pipes) 1256 if (!chip->playback_pipes)
1257 return -ENOMEM; 1257 return -ENOMEM;
1258 chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); 1258 chip->capture_pipes = kcalloc(chip->audio_ins, sizeof(struct vx_pipe *), GFP_KERNEL);
1259 if (!chip->capture_pipes) { 1259 if (!chip->capture_pipes) {
1260 kfree(chip->playback_pipes); 1260 kfree(chip->playback_pipes);
1261 return -ENOMEM; 1261 return -ENOMEM;
1262 } 1262 }
1263 1263
1264 memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs);
1265 memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins);
1266
1267 preferred = chip->ibl.size; 1264 preferred = chip->ibl.size;
1268 chip->ibl.size = 0; 1265 chip->ibl.size = 0;
1269 vx_set_ibl(chip, &chip->ibl); /* query the info */ 1266 vx_set_ibl(chip, &chip->ibl); /* query the info */
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index f4980ca5c05c..1b7c3dfc2b41 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -31,7 +31,7 @@ config SOUND_EMU10K1
31 For more information on this driver and the degree of support for 31 For more information on this driver and the degree of support for
32 the different card models please check: 32 the different card models please check:
33 33
34 <http://sourceforge.net/projects/emu10k1/> 34 <http://sourceforge.net/projects/emu10k1/>
35 35
36 It is now possible to load dsp microcode patches into the EMU10K1 36 It is now possible to load dsp microcode patches into the EMU10K1
37 chip. These patches are used to implement real time sound 37 chip. These patches are used to implement real time sound
@@ -140,7 +140,7 @@ config SOUND_TRIDENT
140 system support" and "Sysctl support", and after the /proc file 140 system support" and "Sysctl support", and after the /proc file
141 system has been mounted, executing the command 141 system has been mounted, executing the command
142 142
143 command what is enabled 143 command what is enabled
144 144
145 echo 0>/proc/ALi5451 pcm out is also set to S/PDIF out. (Default). 145 echo 0>/proc/ALi5451 pcm out is also set to S/PDIF out. (Default).
146 146
@@ -838,7 +838,7 @@ config SOUND_WAVEARTIST
838 838
839config SOUND_TVMIXER 839config SOUND_TVMIXER
840 tristate "TV card (bt848) mixer support" 840 tristate "TV card (bt848) mixer support"
841 depends on SOUND_PRIME && I2C 841 depends on SOUND_PRIME && I2C && VIDEO_V4L1
842 help 842 help
843 Support for audio mixer facilities on the BT848 TV frame-grabber 843 Support for audio mixer facilities on the BT848 TV frame-grabber
844 card. 844 card.
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index d7ad32f514da..e49c0fe21b0d 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -16,16 +16,16 @@ config SND_AD1889
16 will be called snd-ad1889. 16 will be called snd-ad1889.
17 17
18config SND_ALS300 18config SND_ALS300
19 tristate "Avance Logic ALS300/ALS300+" 19 tristate "Avance Logic ALS300/ALS300+"
20 depends on SND 20 depends on SND
21 select SND_PCM 21 select SND_PCM
22 select SND_AC97_CODEC 22 select SND_AC97_CODEC
23 select SND_OPL3_LIB 23 select SND_OPL3_LIB
24 help 24 help
25 Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+ 25 Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
26 26
27 To compile this driver as a module, choose M here: the module 27 To compile this driver as a module, choose M here: the module
28 will be called snd-als300 28 will be called snd-als300
29 29
30config SND_ALS4000 30config SND_ALS4000
31 tristate "Avance Logic ALS4000" 31 tristate "Avance Logic ALS4000"
@@ -78,49 +78,49 @@ config SND_ATIIXP_MODEM
78 will be called snd-atiixp-modem. 78 will be called snd-atiixp-modem.
79 79
80config SND_AU8810 80config SND_AU8810
81 tristate "Aureal Advantage" 81 tristate "Aureal Advantage"
82 depends on SND 82 depends on SND
83 select SND_MPU401_UART 83 select SND_MPU401_UART
84 select SND_AC97_CODEC 84 select SND_AC97_CODEC
85 help 85 help
86 Say Y here to include support for Aureal Advantage soundcards. 86 Say Y here to include support for Aureal Advantage soundcards.
87 87
88 Supported features: Hardware Mixer, SRC, EQ and SPDIF output. 88 Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
89 3D support code is in place, but not yet useable. For more info, 89 3D support code is in place, but not yet useable. For more info,
90 email the ALSA developer list, or <mjander@users.sourceforge.net>. 90 email the ALSA developer list, or <mjander@users.sourceforge.net>.
91 91
92 To compile this driver as a module, choose M here: the module 92 To compile this driver as a module, choose M here: the module
93 will be called snd-au8810. 93 will be called snd-au8810.
94 94
95config SND_AU8820 95config SND_AU8820
96 tristate "Aureal Vortex" 96 tristate "Aureal Vortex"
97 depends on SND 97 depends on SND
98 select SND_MPU401_UART 98 select SND_MPU401_UART
99 select SND_AC97_CODEC 99 select SND_AC97_CODEC
100 help 100 help
101 Say Y here to include support for Aureal Vortex soundcards. 101 Say Y here to include support for Aureal Vortex soundcards.
102 102
103 Supported features: Hardware Mixer and SRC. For more info, email 103 Supported features: Hardware Mixer and SRC. For more info, email
104 the ALSA developer list, or <mjander@users.sourceforge.net>. 104 the ALSA developer list, or <mjander@users.sourceforge.net>.
105 105
106 To compile this driver as a module, choose M here: the module 106 To compile this driver as a module, choose M here: the module
107 will be called snd-au8820. 107 will be called snd-au8820.
108 108
109config SND_AU8830 109config SND_AU8830
110 tristate "Aureal Vortex 2" 110 tristate "Aureal Vortex 2"
111 depends on SND 111 depends on SND
112 select SND_MPU401_UART 112 select SND_MPU401_UART
113 select SND_AC97_CODEC 113 select SND_AC97_CODEC
114 help 114 help
115 Say Y here to include support for Aureal Vortex 2 soundcards. 115 Say Y here to include support for Aureal Vortex 2 soundcards.
116 116
117 Supported features: Hardware Mixer, SRC, EQ and SPDIF output. 117 Supported features: Hardware Mixer, SRC, EQ and SPDIF output.
118 3D support code is in place, but not yet useable. For more info, 118 3D support code is in place, but not yet useable. For more info,
119 email the ALSA developer list, or <mjander@users.sourceforge.net>. 119 email the ALSA developer list, or <mjander@users.sourceforge.net>.
120 120
121 To compile this driver as a module, choose M here: the module 121 To compile this driver as a module, choose M here: the module
122 will be called snd-au8830. 122 will be called snd-au8830.
123 123
124config SND_AZT3328 124config SND_AZT3328
125 tristate "Aztech AZF3328 / PCI168 (EXPERIMENTAL)" 125 tristate "Aztech AZF3328 / PCI168 (EXPERIMENTAL)"
126 depends on SND && EXPERIMENTAL 126 depends on SND && EXPERIMENTAL
@@ -135,10 +135,10 @@ config SND_AZT3328
135 will be called snd-azt3328. 135 will be called snd-azt3328.
136 136
137config SND_BT87X 137config SND_BT87X
138 tristate "Bt87x Audio Capture" 138 tristate "Bt87x Audio Capture"
139 depends on SND 139 depends on SND
140 select SND_PCM 140 select SND_PCM
141 help 141 help
142 If you want to record audio from TV cards based on 142 If you want to record audio from TV cards based on
143 Brooktree Bt878/Bt879 chips, say Y here and read 143 Brooktree Bt878/Bt879 chips, say Y here and read
144 <file:Documentation/sound/alsa/Bt87x.txt>. 144 <file:Documentation/sound/alsa/Bt87x.txt>.
@@ -209,7 +209,7 @@ config SND_CS46XX
209config SND_CS46XX_NEW_DSP 209config SND_CS46XX_NEW_DSP
210 bool "Cirrus Logic (Sound Fusion) New DSP support" 210 bool "Cirrus Logic (Sound Fusion) New DSP support"
211 depends on SND_CS46XX 211 depends on SND_CS46XX
212 default y 212 default y
213 help 213 help
214 Say Y here to use a new DSP image for SPDIF and dual codecs. 214 Say Y here to use a new DSP image for SPDIF and dual codecs.
215 215
@@ -225,7 +225,7 @@ config SND_CS5535AUDIO
225 referred to as NS CS5535 IO or AMD CS5535 IO companion in 225 referred to as NS CS5535 IO or AMD CS5535 IO companion in
226 various literature. This driver also supports the CS5536 audio 226 various literature. This driver also supports the CS5536 audio
227 device. However, for both chips, on certain boards, you may 227 device. However, for both chips, on certain boards, you may
228 need to use ac97_quirk=hp_only if your board has physically 228 need to use ac97_quirk=hp_only if your board has physically
229 mapped headphone out to master output. If that works for you, 229 mapped headphone out to master output. If that works for you,
230 send lspci -vvv output to the mailing list so that your board 230 send lspci -vvv output to the mailing list so that your board
231 can be identified in the quirks list. 231 can be identified in the quirks list.
@@ -468,11 +468,13 @@ config SND_FM801_TEA575X_BOOL
468 FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media 468 FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media
469 Forte SF256-PCS-02) into the snd-fm801 driver. 469 Forte SF256-PCS-02) into the snd-fm801 driver.
470 470
471 This will enable support for the old V4L1 API.
472
471config SND_FM801_TEA575X 473config SND_FM801_TEA575X
472 tristate 474 tristate
473 depends on SND_FM801_TEA575X_BOOL 475 depends on SND_FM801_TEA575X_BOOL
474 default SND_FM801 476 default SND_FM801
475 select VIDEO_DEV 477 select VIDEO_V4L1
476 478
477config SND_HDA_INTEL 479config SND_HDA_INTEL
478 tristate "Intel HD Audio" 480 tristate "Intel HD Audio"
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 27a8dbe6f6a8..c3dafa29054f 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -236,9 +236,9 @@ static int pcm_open(struct snd_pcm_substream *substream,
236 chip = snd_pcm_substream_chip(substream); 236 chip = snd_pcm_substream_chip(substream);
237 runtime = substream->runtime; 237 runtime = substream->runtime;
238 238
239 if (!(pipe = kmalloc(sizeof(struct audiopipe), GFP_KERNEL))) 239 pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL);
240 if (!pipe)
240 return -ENOMEM; 241 return -ENOMEM;
241 memset(pipe, 0, sizeof(struct audiopipe));
242 pipe->index = -1; /* Not configured yet */ 242 pipe->index = -1; /* Not configured yet */
243 243
244 /* Set up hw capabilities and contraints */ 244 /* Set up hw capabilities and contraints */
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index f9b5c3dc3b34..79f24cdf5fbf 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -936,6 +936,17 @@ static struct snd_emu_chip_details emu_chip_details[] = {
936 .ca0151_chip = 1, 936 .ca0151_chip = 1,
937 .spk71 = 1, 937 .spk71 = 1,
938 .spdif_bug = 1} , 938 .spdif_bug = 1} ,
939 /* Dell OEM/Creative Labs Audigy 2 ZS */
940 /* See ALSA bug#1365 */
941 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10031102,
942 .driver = "Audigy2", .name = "Audigy 2 ZS [SB0353]",
943 .id = "Audigy2",
944 .emu10k2_chip = 1,
945 .ca0102_chip = 1,
946 .ca0151_chip = 1,
947 .spk71 = 1,
948 .spdif_bug = 1,
949 .ac97_chip = 1} ,
939 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102, 950 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
940 .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]", 951 .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]",
941 .id = "Audigy2", 952 .id = "Audigy2",
diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
index a8b31286b6db..1076af4c3669 100644
--- a/sound/pci/emu10k1/irq.c
+++ b/sound/pci/emu10k1/irq.c
@@ -37,9 +37,13 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
37 int handled = 0; 37 int handled = 0;
38 38
39 while ((status = inl(emu->port + IPR)) != 0) { 39 while ((status = inl(emu->port + IPR)) != 0) {
40 //printk("emu10k1 irq - status = 0x%x\n", status); 40 //snd_printk(KERN_INFO "emu10k1 irq - status = 0x%x\n", status);
41 orig_status = status; 41 orig_status = status;
42 handled = 1; 42 handled = 1;
43 if ((status & 0xffffffff) == 0xffffffff) {
44 snd_printk(KERN_INFO "snd-emu10k1: Suspected sound card removal\n");
45 break;
46 }
43 if (status & IPR_PCIERROR) { 47 if (status & IPR_PCIERROR) {
44 snd_printk(KERN_ERR "interrupt: PCI error\n"); 48 snd_printk(KERN_ERR "interrupt: PCI error\n");
45 snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE); 49 snd_emu10k1_intr_disable(emu, INTE_PCIERRORENABLE);
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c
index 82d791be7499..05dabe454658 100644
--- a/sound/ppc/awacs.c
+++ b/sound/ppc/awacs.c
@@ -801,11 +801,10 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
801 chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf; 801 chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
802#ifdef PMAC_AMP_AVAIL 802#ifdef PMAC_AMP_AVAIL
803 if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) { 803 if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) {
804 struct awacs_amp *amp = kmalloc(sizeof(*amp), GFP_KERNEL); 804 struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL);
805 if (! amp) 805 if (! amp)
806 return -ENOMEM; 806 return -ENOMEM;
807 chip->mixer_data = amp; 807 chip->mixer_data = amp;
808 memset(amp, 0, sizeof(*amp));
809 chip->mixer_free = awacs_amp_free; 808 chip->mixer_free = awacs_amp_free;
810 awacs_amp_set_vol(amp, 0, 63, 63, 0); /* mute and zero vol */ 809 awacs_amp_set_vol(amp, 0, 63, 63, 0); /* mute and zero vol */
811 awacs_amp_set_vol(amp, 1, 63, 63, 0); 810 awacs_amp_set_vol(amp, 1, 63, 63, 0);
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c
index 46eebf5610e3..57202b0f033e 100644
--- a/sound/ppc/daca.c
+++ b/sound/ppc/daca.c
@@ -258,10 +258,9 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
258 request_module("i2c-powermac"); 258 request_module("i2c-powermac");
259#endif /* CONFIG_KMOD */ 259#endif /* CONFIG_KMOD */
260 260
261 mix = kmalloc(sizeof(*mix), GFP_KERNEL); 261 mix = kzalloc(sizeof(*mix), GFP_KERNEL);
262 if (! mix) 262 if (! mix)
263 return -ENOMEM; 263 return -ENOMEM;
264 memset(mix, 0, sizeof(*mix));
265 chip->mixer_data = mix; 264 chip->mixer_data = mix;
266 chip->mixer_free = daca_cleanup; 265 chip->mixer_free = daca_cleanup;
267 mix->amp_on = 1; /* default on */ 266 mix->amp_on = 1; /* default on */
diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c
index fb05938dcbd9..59482a4cd446 100644
--- a/sound/ppc/keywest.c
+++ b/sound/ppc/keywest.c
@@ -64,11 +64,10 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
64 if (strncmp(i2c_device_name(adapter), "mac-io", 6)) 64 if (strncmp(i2c_device_name(adapter), "mac-io", 6))
65 return 0; /* ignored */ 65 return 0; /* ignored */
66 66
67 new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 67 new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
68 if (! new_client) 68 if (! new_client)
69 return -ENOMEM; 69 return -ENOMEM;
70 70
71 memset(new_client, 0, sizeof(*new_client));
72 new_client->addr = keywest_ctx->addr; 71 new_client->addr = keywest_ctx->addr;
73 i2c_set_clientdata(new_client, keywest_ctx); 72 i2c_set_clientdata(new_client, keywest_ctx);
74 new_client->adapter = adapter; 73 new_client->adapter = adapter;
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index fa9a44ab487e..2264574fa06b 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -181,21 +181,14 @@ static int __init alsa_card_pmac_init(void)
181 if ((err = platform_driver_register(&snd_pmac_driver)) < 0) 181 if ((err = platform_driver_register(&snd_pmac_driver)) < 0)
182 return err; 182 return err;
183 device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0); 183 device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0);
184 if (!IS_ERR(device)) { 184 return 0;
185 if (platform_get_drvdata(device))
186 return 0;
187 platform_device_unregister(device);
188 err = -ENODEV;
189 } else
190 err = PTR_ERR(device);
191 platform_driver_unregister(&snd_pmac_driver);
192 return err;
193 185
194} 186}
195 187
196static void __exit alsa_card_pmac_exit(void) 188static void __exit alsa_card_pmac_exit(void)
197{ 189{
198 platform_device_unregister(device); 190 if (!IS_ERR(device))
191 platform_device_unregister(device);
199 platform_driver_unregister(&snd_pmac_driver); 192 platform_driver_unregister(&snd_pmac_driver);
200} 193}
201 194
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 692c61177678..84f6b19c07ca 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1316,10 +1316,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
1316 request_module("i2c-powermac"); 1316 request_module("i2c-powermac");
1317#endif /* CONFIG_KMOD */ 1317#endif /* CONFIG_KMOD */
1318 1318
1319 mix = kmalloc(sizeof(*mix), GFP_KERNEL); 1319 mix = kzalloc(sizeof(*mix), GFP_KERNEL);
1320 if (! mix) 1320 if (! mix)
1321 return -ENOMEM; 1321 return -ENOMEM;
1322 memset(mix, 0, sizeof(*mix));
1323 mix->headphone_irq = -1; 1322 mix->headphone_irq = -1;
1324 1323
1325 chip->mixer_data = mix; 1324 chip->mixer_data = mix;
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index d32d83d970cc..1b7f499c549d 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2260,10 +2260,9 @@ static int add_audio_endpoint(struct snd_usb_audio *chip, int stream, struct aud
2260 } 2260 }
2261 2261
2262 /* create a new pcm */ 2262 /* create a new pcm */
2263 as = kmalloc(sizeof(*as), GFP_KERNEL); 2263 as = kzalloc(sizeof(*as), GFP_KERNEL);
2264 if (! as) 2264 if (! as)
2265 return -ENOMEM; 2265 return -ENOMEM;
2266 memset(as, 0, sizeof(*as));
2267 as->pcm_index = chip->pcm_devs; 2266 as->pcm_index = chip->pcm_devs;
2268 as->chip = chip; 2267 as->chip = chip;
2269 as->fmt_type = fp->fmt_type; 2268 as->fmt_type = fp->fmt_type;
@@ -2633,13 +2632,12 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
2633 csep = NULL; 2632 csep = NULL;
2634 } 2633 }
2635 2634
2636 fp = kmalloc(sizeof(*fp), GFP_KERNEL); 2635 fp = kzalloc(sizeof(*fp), GFP_KERNEL);
2637 if (! fp) { 2636 if (! fp) {
2638 snd_printk(KERN_ERR "cannot malloc\n"); 2637 snd_printk(KERN_ERR "cannot malloc\n");
2639 return -ENOMEM; 2638 return -ENOMEM;
2640 } 2639 }
2641 2640
2642 memset(fp, 0, sizeof(*fp));
2643 fp->iface = iface_no; 2641 fp->iface = iface_no;
2644 fp->altsetting = altno; 2642 fp->altsetting = altno;
2645 fp->altset_idx = i; 2643 fp->altset_idx = i;