forked from luck/tmp_suning_uos_patched
ALSA: gus: add a check of the status of snd_ctl_add
snd_ctl_add() could fail, so let's check its status and issue an error message if it indeed fails. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4bccb403f2
commit
0f25e000cb
|
@ -92,8 +92,17 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = {
|
|||
|
||||
static void snd_gus_init_control(struct snd_gus_card *gus)
|
||||
{
|
||||
if (!gus->ace_flag)
|
||||
snd_ctl_add(gus->card, snd_ctl_new1(&snd_gus_joystick_control, gus));
|
||||
int ret;
|
||||
|
||||
if (!gus->ace_flag) {
|
||||
ret =
|
||||
snd_ctl_add(gus->card,
|
||||
snd_ctl_new1(&snd_gus_joystick_control,
|
||||
gus));
|
||||
if (ret)
|
||||
snd_printk(KERN_ERR "gus: snd_ctl_add failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user