aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-02-18 17:48:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-18 18:37:56 -0500
commitbe50344e604f956891fc0013f1ba78823a758124 (patch)
treef857656b717750fce8ddc4e3d2784b182d0aff60 /drivers/spi
parent97bef7dd05563807539122c488a5dd93ed327722 (diff)
spi-gpio: sanitize MISO bitvalue
gpio_get_value() returns 0 or nonzero, but getmiso() expects 0 or 1. Sanitize the value to a 0/1 boolean. Signed-off-by: Michael Buesch <mb@bu3sch.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi_gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi_gpio.c b/drivers/spi/spi_gpio.c
index 49698cabc30d..f5ed9721aabb 100644
--- a/drivers/spi/spi_gpio.c
+++ b/drivers/spi/spi_gpio.c
@@ -114,7 +114,7 @@ static inline void setmosi(const struct spi_device *spi, int is_on)
114 114
115static inline int getmiso(const struct spi_device *spi) 115static inline int getmiso(const struct spi_device *spi)
116{ 116{
117 return gpio_get_value(SPI_MISO_GPIO); 117 return !!gpio_get_value(SPI_MISO_GPIO);
118} 118}
119 119
120#undef pdata 120#undef pdata