emux.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) | emux.c (5e246b850df563224be26f1d409cf66fd6c968df) |
---|---|
1/* 2 * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> 3 * 4 * Routines for control of EMU WaveTable chip 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 79 unchanged lines hidden (view full) --- 88 emu->ops.sample_reset(emu); 89} 90 91int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name) 92{ 93 int err; 94 struct snd_sf_callback sf_cb; 95 | 1/* 2 * Copyright (C) 2000 Takashi Iwai <tiwai@suse.de> 3 * 4 * Routines for control of EMU WaveTable chip 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 79 unchanged lines hidden (view full) --- 88 emu->ops.sample_reset(emu); 89} 90 91int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name) 92{ 93 int err; 94 struct snd_sf_callback sf_cb; 95 |
96 snd_assert(emu->hw != NULL, return -EINVAL); 97 snd_assert(emu->max_voices > 0, return -EINVAL); 98 snd_assert(card != NULL, return -EINVAL); 99 snd_assert(name != NULL, return -EINVAL); | 96 if (snd_BUG_ON(!emu->hw || emu->max_voices <= 0)) 97 return -EINVAL; 98 if (snd_BUG_ON(!card || !name)) 99 return -EINVAL; |
100 101 emu->card = card; 102 emu->name = kstrdup(name, GFP_KERNEL); 103 emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), 104 GFP_KERNEL); 105 if (emu->voices == NULL) 106 return -ENOMEM; 107 --- 84 unchanged lines hidden --- | 100 101 emu->card = card; 102 emu->name = kstrdup(name, GFP_KERNEL); 103 emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice), 104 GFP_KERNEL); 105 if (emu->voices == NULL) 106 return -ENOMEM; 107 --- 84 unchanged lines hidden --- |