diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 11:44:01 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:28:58 -0500 |
commit | 73e77ba0235532bd7523ba90883d325f6e095acf (patch) | |
tree | d22f29805ade9e78bd5f1802590d42f6e121c3c1 /sound/core/control.c | |
parent | 00a4e3d9f8df8a90966b75d517154718b4a2242a (diff) |
[ALSA] Add error messages
Add error messages in the critial error path to be more verbose.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/control.c')
-rw-r--r-- | sound/core/control.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 03ae9bb7d38e..f8f98cc52417 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -195,8 +195,10 @@ struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, unsigned int acce | |||
195 | snd_assert(control != NULL, return NULL); | 195 | snd_assert(control != NULL, return NULL); |
196 | snd_assert(control->count > 0, return NULL); | 196 | snd_assert(control->count > 0, return NULL); |
197 | kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); | 197 | kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); |
198 | if (kctl == NULL) | 198 | if (kctl == NULL) { |
199 | snd_printk(KERN_ERR "Cannot allocate control instance\n"); | ||
199 | return NULL; | 200 | return NULL; |
201 | } | ||
200 | *kctl = *control; | 202 | *kctl = *control; |
201 | for (idx = 0; idx < kctl->count; idx++) | 203 | for (idx = 0; idx < kctl->count; idx++) |
202 | kctl->vd[idx].access = access; | 204 | kctl->vd[idx].access = access; |
@@ -309,7 +311,9 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) | |||
309 | struct snd_ctl_elem_id id; | 311 | struct snd_ctl_elem_id id; |
310 | unsigned int idx; | 312 | unsigned int idx; |
311 | 313 | ||
312 | snd_assert(card != NULL && kcontrol != NULL, return -EINVAL); | 314 | snd_assert(card != NULL, return -EINVAL); |
315 | if (! kcontrol) | ||
316 | return -EINVAL; | ||
313 | snd_assert(kcontrol->info != NULL, return -EINVAL); | 317 | snd_assert(kcontrol->info != NULL, return -EINVAL); |
314 | id = kcontrol->id; | 318 | id = kcontrol->id; |
315 | down_write(&card->controls_rwsem); | 319 | down_write(&card->controls_rwsem); |