From: Takashi Iwai Subject: Re: [PATCH 1/2 v2] ALSA: Add snd_ctl_update() to dynamically update a control Date: Tue, 15 Mar 2011 15:25:04 +0100 Message-ID: References: <1300192269-20435-1-git-send-email-dp@opensource.wolfsonmicro.com> <4D7F7516.7050009@ladisch.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 9BEF51038E2 for ; Tue, 15 Mar 2011 15:25:05 +0100 (CET) In-Reply-To: <4D7F7516.7050009@ladisch.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Clemens Ladisch Cc: Dimitris Papastamos , alsa-devel@alsa-project.org, Mark Brown , patches@opensource.wolfsonmicro.com, lrg@ti.com, lrg@slimlogic.co.uk List-Id: alsa-devel@alsa-project.org At Tue, 15 Mar 2011 15:17:58 +0100, Clemens Ladisch wrote: > > > + up_write(&card->controls_rwsem); > > + ret = snd_ctl_add(card, kcontrol); > > Doing this outside the semaphore doesn't look good. Using an internal function without semaphore would be preferred, yes. > I wonder whether snd_ctl_add() is the right function to use, because it > will assign a different numid event if the control didn't change. Hm, actually the function can compare whether it's really changed or not. If any change, it makes really sense to assign a different numid. Takashi