summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-20 12:28:29 +0300
committerMark Brown <broonie@kernel.org>2015-10-21 15:27:37 +0300
commit243f07be2423efe0b17e8ffafc9a36dad50406d3 (patch)
tree9ea3ea58dbb9ca116b45e8a179b6faa3729df5fe /drivers/spi
parent5ab8d262122bc951b308e51cdcc55bc67b1f5fdb (diff)
downloadlinux-243f07be2423efe0b17e8ffafc9a36dad50406d3.tar.xz
spi: core: use gpio_is_valid() helper
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 64c1aedde481..9136f30a9fbd 100644
--- 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);