From: Takashi Iwai Subject: Re: [PATCH] ALSA: core: Allow card id change to the same string Date: Thu, 16 Sep 2010 10:20:04 +0200 Message-ID: References: <1284622014-1341-1-git-send-email-peter.ujfalusi@nokia.com> 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 5459C2435F for ; Thu, 16 Sep 2010 10:20:04 +0200 (CEST) In-Reply-To: <1284622014-1341-1-git-send-email-peter.ujfalusi@nokia.com> 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: Peter Ujfalusi Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 16 Sep 2010 10:26:54 +0300, Peter Ujfalusi wrote: > > When user want to change the card id to the same string > on the card via /sys/class/sound/cardX/id, do not > report error. Instead return with success without > doing anything. > > Signed-off-by: Peter Ujfalusi Thanks, applied now. Takashi > --- > sound/core/init.c | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/sound/core/init.c b/sound/core/init.c > index ec4a50c..2de45fb 100644 > --- a/sound/core/init.c > +++ b/sound/core/init.c > @@ -607,11 +607,16 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr, > return -EEXIST; > } > for (idx = 0; idx < snd_ecards_limit; idx++) { > - if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) > - goto __exist; > + if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) { > + if (card == snd_cards[idx]) > + goto __ok; > + else > + goto __exist; > + } > } > strcpy(card->id, buf1); > snd_info_card_id_change(card); > +__ok: > mutex_unlock(&snd_card_mutex); > > return count; > -- > 1.7.2.2 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >