[alsa-devel] [PATCH 4/8] ALSA: control: add a comment about locking values after creating

Takashi Sakamoto o-takashi at sakamocchi.jp
Wed Feb 11 11:37:28 CET 2015


All of created user controls are locked before added to system. This may
be against programmers or users expectation.

This commit adds a comment about this.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 sound/core/control.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/core/control.c b/sound/core/control.c
index 0baff92..19f9f4e 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1255,8 +1255,11 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
 		return -ENOMEM;
 	}
 	_kctl->private_data = ue;
+
+	/* Lock values in this user controls. */
 	for (idx = 0; idx < _kctl->count; idx++)
 		_kctl->vd[idx].owner = file;
+
 	err = snd_ctl_add(card, _kctl);
 	if (err < 0)
 		return err;
-- 
2.1.0



More information about the Alsa-devel mailing list