projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ab8d26
)
spi: core: use gpio_is_valid() helper
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Tue, 20 Oct 2015 09:28:29 +0000
(12:28 +0300)
committer
Mark Brown
<broonie@kernel.org>
Wed, 21 Oct 2015 12:27:37 +0000
(13:27 +0100)
Check if GPIO pin is valid by API helper function.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/spi/spi.c
b/drivers/spi/spi.c
index 64c1aedde4817f8524d66ad8a829d2eb576f3194..9136f30a9fbd6db8c5e440ea50875e50deed6285 100644
(file)
--- a/
drivers/spi/spi.c
+++ b/
drivers/spi/spi.c
@@
-606,7
+606,7
@@
static void spi_set_cs(struct spi_device *spi, bool enable)
if (spi->mode & SPI_CS_HIGH)
enable = !enable;
- if (
spi->cs_gpio >= 0
)
+ if (
gpio_is_valid(spi->cs_gpio)
)
gpio_set_value(spi->cs_gpio, !enable);
else if (spi->master->set_cs)
spi->master->set_cs(spi, !enable);