]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: control: Consolidate helpers for adding and replacing ctl elements
authorTakashi Iwai <tiwai@suse.de>
Thu, 22 Nov 2018 14:22:40 +0000 (15:22 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sat, 24 Nov 2018 19:04:10 +0000 (20:04 +0100)
commite90382d753748f5866548e5a7b55a7d7612a3651
tree5ed66d16a2ff3192a898ee091539634943efb1ca
parent3d0192898fc3faa31ae5035d6b88538fb545aade
ALSA: control: Consolidate helpers for adding and replacing ctl elements

Both snd_ctl_add() and snd_ctl_replace() process the things in a
fairly similar way, and indeed the most of the codes can be unified.

This patch is a refactoring to consolidate the both functions to call
a single helper with an extra "mode" argument.  There should be no
functional difference, except for one additional sanity check applied
now to snd_ctl_replace() (which was rather overlooking, IMO), too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control.c