From patchwork Wed Feb 11 10:37:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 5811931 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF1A19F30C for ; Wed, 11 Feb 2015 10:40:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 074062022A for ; Wed, 11 Feb 2015 10:40:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 21D7D20212 for ; Wed, 11 Feb 2015 10:40:44 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 540E4265066; Wed, 11 Feb 2015 11:40:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 54978261A5E; Wed, 11 Feb 2015 11:37:55 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 242012605D7; Wed, 11 Feb 2015 11:37:50 +0100 (CET) Received: from smtp303.phy.lolipop.jp (smtp303.phy.lolipop.jp [210.157.22.87]) by alsa0.perex.cz (Postfix) with ESMTP id CD3E12605D0 for ; Wed, 11 Feb 2015 11:37:40 +0100 (CET) Received: from smtp303.phy.lolipop.lan (HELO smtp303.phy.lolipop.jp) (172.17.1.87) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp303.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Wed, 11 Feb 2015 19:37:36 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp303.phy.lolipop.jp (LOLIPOP-Fsecure); Wed, 11 Feb 2015 19:37:33 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Wed, 11 Feb 2015 19:37:28 +0900 Message-Id: <1423651052-19593-5-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423651052-19593-1-git-send-email-o-takashi@sakamocchi.jp> References: <1423651052-19593-1-git-send-email-o-takashi@sakamocchi.jp> Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 4/8] ALSA: control: add a comment about locking values after creating X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;