Skip to content

Commit

Permalink
ALSA: atmel/ac97c: correct the unexpected behavior when using uniniti…
Browse files Browse the repository at this point in the history
…al 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>
  • Loading branch information
Bo Shen authored and Takashi Iwai committed May 11, 2012
1 parent 2abb801 commit b2522f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/atmel/ac97c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b2522f9

Please sign in to comment.