aboutsummaryrefslogtreecommitdiffstats
path: root/sound/atmel
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2012-05-11 05:39:28 -0400
committerTakashi Iwai <tiwai@suse.de>2012-05-11 06:10:04 -0400
commitb2522f9262539fc328b4b9344f8a2f7ef2cb18d5 (patch)
treeb3a3ab5a135c32591033ec9842d4103b36d20eb2 /sound/atmel
parent2abb80176cd80ad8e939ead9c785ac17dc9890a4 (diff)
ALSA: atmel/ac97c: correct the unexpected behavior when using uninitial value for reset pin
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> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/atmel')
-rw-r--r--sound/atmel/ac97c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 115313ef54d6..f5ded640b395 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)
991 gpio_direction_output(pdata->reset_pin, 1); 991 gpio_direction_output(pdata->reset_pin, 1);
992 chip->reset_pin = pdata->reset_pin; 992 chip->reset_pin = pdata->reset_pin;
993 } 993 }
994 } else {
995 chip->reset_pin = -EINVAL;
994 } 996 }
995 997
996 snd_card_set_dev(card, &pdev->dev); 998 snd_card_set_dev(card, &pdev->dev);