mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] atmel/ac97c: correct the unexpected behavior when using uninitial value for reset pin
@ 2012-05-11  9:39 Bo Shen
  2012-05-11 10:10 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Bo Shen @ 2012-05-11  9:39 UTC (permalink / raw)
  To: tiwai
  Cc: linux-kernel, linux-sound, alsa-devel, nicolas.ferre, plagnioj,
	josh.wu, jm.lin, Bo Shen

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 <voice.shen@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-11 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11  9:39 [PATCH] atmel/ac97c: correct the unexpected behavior when using uninitial value for reset pin Bo Shen
2012-05-11 10:10 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®