Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be50344e authored by Michael Buesch's avatar Michael Buesch Committed by Linus Torvalds
Browse files

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: default avatarMichael Buesch <mb@bu3sch.de>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 97bef7dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ static inline void setmosi(const struct spi_device *spi, int is_on)

static inline int getmiso(const struct spi_device *spi)
{
	return gpio_get_value(SPI_MISO_GPIO);
	return !!gpio_get_value(SPI_MISO_GPIO);
}

#undef pdata