aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth/emux/emux_oss.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
commit6dc6472581f693b5fc95aebedf67b4960fb85cf0 (patch)
tree06a5a9a08519950575505273eabced331ed51405 /sound/synth/emux/emux_oss.c
parentee673eaa72d8d185012b1027a05e25aba18c267f (diff)
parent8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (diff)
Merge commit 'origin'
Manual fixup of conflicts on: arch/powerpc/include/asm/dcr-regs.h drivers/net/ibm_newemac/core.h
Diffstat (limited to 'sound/synth/emux/emux_oss.c')
-rw-r--r--sound/synth/emux/emux_oss.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index f60a98ef7dec..5c47b6c09264 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -114,7 +114,8 @@ snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
114 char tmpname[64]; 114 char tmpname[64];
115 115
116 emu = closure; 116 emu = closure;
117 snd_assert(arg != NULL && emu != NULL, return -ENXIO); 117 if (snd_BUG_ON(!arg || !emu))
118 return -ENXIO;
118 119
119 mutex_lock(&emu->register_mutex); 120 mutex_lock(&emu->register_mutex);
120 121
@@ -183,12 +184,15 @@ snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg)
183 struct snd_emux *emu; 184 struct snd_emux *emu;
184 struct snd_emux_port *p; 185 struct snd_emux_port *p;
185 186
186 snd_assert(arg != NULL, return -ENXIO); 187 if (snd_BUG_ON(!arg))
188 return -ENXIO;
187 p = arg->private_data; 189 p = arg->private_data;
188 snd_assert(p != NULL, return -ENXIO); 190 if (snd_BUG_ON(!p))
191 return -ENXIO;
189 192
190 emu = p->emu; 193 emu = p->emu;
191 snd_assert(emu != NULL, return -ENXIO); 194 if (snd_BUG_ON(!emu))
195 return -ENXIO;
192 196
193 mutex_lock(&emu->register_mutex); 197 mutex_lock(&emu->register_mutex);
194 snd_emux_sounds_off_all(p); 198 snd_emux_sounds_off_all(p);
@@ -212,12 +216,15 @@ snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
212 struct snd_emux_port *p; 216 struct snd_emux_port *p;
213 int rc; 217 int rc;
214 218
215 snd_assert(arg != NULL, return -ENXIO); 219 if (snd_BUG_ON(!arg))
220 return -ENXIO;
216 p = arg->private_data; 221 p = arg->private_data;
217 snd_assert(p != NULL, return -ENXIO); 222 if (snd_BUG_ON(!p))
223 return -ENXIO;
218 224
219 emu = p->emu; 225 emu = p->emu;
220 snd_assert(emu != NULL, return -ENXIO); 226 if (snd_BUG_ON(!emu))
227 return -ENXIO;
221 228
222 if (format == GUS_PATCH) 229 if (format == GUS_PATCH)
223 rc = snd_soundfont_load_guspatch(emu->sflist, buf, count, 230 rc = snd_soundfont_load_guspatch(emu->sflist, buf, count,
@@ -252,12 +259,15 @@ snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned l
252 struct snd_emux_port *p; 259 struct snd_emux_port *p;
253 struct snd_emux *emu; 260 struct snd_emux *emu;
254 261
255 snd_assert(arg != NULL, return -ENXIO); 262 if (snd_BUG_ON(!arg))
263 return -ENXIO;
256 p = arg->private_data; 264 p = arg->private_data;
257 snd_assert(p != NULL, return -ENXIO); 265 if (snd_BUG_ON(!p))
266 return -ENXIO;
258 267
259 emu = p->emu; 268 emu = p->emu;
260 snd_assert(emu != NULL, return -ENXIO); 269 if (snd_BUG_ON(!emu))
270 return -ENXIO;
261 271
262 switch (cmd) { 272 switch (cmd) {
263 case SNDCTL_SEQ_RESETSAMPLES: 273 case SNDCTL_SEQ_RESETSAMPLES:
@@ -282,9 +292,11 @@ snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg)
282{ 292{
283 struct snd_emux_port *p; 293 struct snd_emux_port *p;
284 294
285 snd_assert(arg != NULL, return -ENXIO); 295 if (snd_BUG_ON(!arg))
296 return -ENXIO;
286 p = arg->private_data; 297 p = arg->private_data;
287 snd_assert(p != NULL, return -ENXIO); 298 if (snd_BUG_ON(!p))
299 return -ENXIO;
288 snd_emux_reset_port(p); 300 snd_emux_reset_port(p);
289 return 0; 301 return 0;
290} 302}
@@ -302,9 +314,11 @@ snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_dat
302 unsigned char cmd, *data; 314 unsigned char cmd, *data;
303 315
304 p = private_data; 316 p = private_data;
305 snd_assert(p != NULL, return -EINVAL); 317 if (snd_BUG_ON(!p))
318 return -EINVAL;
306 emu = p->emu; 319 emu = p->emu;
307 snd_assert(emu != NULL, return -EINVAL); 320 if (snd_BUG_ON(!emu))
321 return -EINVAL;
308 if (ev->type != SNDRV_SEQ_EVENT_OSS) 322 if (ev->type != SNDRV_SEQ_EVENT_OSS)
309 return snd_emux_event_input(ev, direct, private_data, atomic, hop); 323 return snd_emux_event_input(ev, direct, private_data, atomic, hop);
310 324