ALSA: control: fix failure to return numerical ID in 'add' event
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 8 Feb 2015 13:39:44 +0000 (22:39 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sun, 8 Feb 2015 14:31:09 +0000 (15:31 +0100)
Currently when adding a new control, the assigned numerical ID is not
set for event data, thus userspace applications cannot realize it just
by event data.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c

index 60caba1f22116394f5e999aa8a36aea4dbd162be..8aae6eaa3564f773022db871abc32a1a46842a98 100644 (file)
@@ -373,6 +373,7 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol)
        card->controls_count += kcontrol->count;
        kcontrol->id.numid = card->last_numid + 1;
        card->last_numid += kcontrol->count;
+       id = kcontrol->id;
        count = kcontrol->count;
        up_write(&card->controls_rwsem);
        for (idx = 0; idx < count; idx++, id.index++, id.numid++)