From: Bo Shen Date: Fri, 11 May 2012 09:39:28 +0000 (+0800) Subject: ALSA: atmel/ac97c: correct the unexpected behavior when using uninitial value for... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b2522f9262539fc328b4b9344f8a2f7ef2cb18d5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Nicolas Ferre Signed-off-by: Takashi Iwai --- 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) 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);