]> git.baikalelectronics.ru Git - kernel.git/commit
spi/i.MX: fix broken error handling for gpio_request
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 24 Nov 2009 16:53:07 +0000 (16:53 +0000)
committerGrant Likely <grant.likely@secretlab.ca>
Wed, 9 Dec 2009 01:48:16 +0000 (18:48 -0700)
commita42b03819d72d9efbe30f4eb17d64dbf57dc15ba
tree9a4da1f3a330ecdc5c6bbba7494940d74376ce79
parent3c566b5a3b9a5ac612e7fa1c4f197496f149041a
spi/i.MX: fix broken error handling for gpio_request

i.MX35-provided chipselects are represented using negative numbers. If
gpio_request() fails and the previous chipselect was a negative number,
the while loop is endless (i is never decremented).

Also, the error loop would never call gpio_free on chipselect[0].

And finally, the error message was missing an endline.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/spi_imx.c