Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030220Ab2EKKKo (ORCPT ); Fri, 11 May 2012 06:10:44 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47529 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752887Ab2EKKKm (ORCPT ); Fri, 11 May 2012 06:10:42 -0400 Date: Fri, 11 May 2012 12:10:41 +0200 Message-ID: From: Takashi Iwai To: Bo Shen Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, alsa-devel@alsa-project.org, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, josh.wu@atmel.com, jm.lin@atmel.com Subject: Re: [PATCH] atmel/ac97c: correct the unexpected behavior when using uninitial value for reset pin In-Reply-To: <1336729168-20562-1-git-send-email-voice.shen@atmel.com> References: <1336729168-20562-1-git-send-email-voice.shen@atmel.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1202 Lines: 42 At Fri, 11 May 2012 17:39:28 +0800, Bo Shen wrote: > > When pdata->reset_pin is passed with a negative value (means gpio > is invalid), then chip->reset_pin will not be assigned to a vaule, > it will use default value 0. This will cause unexpected behavior. > > So, add this patch to correct. > > Signed-off-by: Bo Shen > Acked-by: Nicolas Ferre Applied now. Thanks. Takashi > --- > sound/atmel/ac97c.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c > index 115313e..f5ded64 100644 > --- a/sound/atmel/ac97c.c > +++ b/sound/atmel/ac97c.c > @@ -991,6 +991,8 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev) > gpio_direction_output(pdata->reset_pin, 1); > chip->reset_pin = pdata->reset_pin; > } > + } else { > + chip->reset_pin = -EINVAL; > } > > snd_card_set_dev(card, &pdev->dev); > -- > 1.7.10 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/