summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-20 11:28:29 +0200
committerMark Brown <broonie@kernel.org>2015-10-21 14:27:37 +0200
commit243f07be2423efe0b17e8ffafc9a36dad50406d3 (patch)
tree9ea3ea58dbb9ca116b45e8a179b6faa3729df5fe /drivers/spi/spi.c
parentspi: core: propagate return code of __spi_validate_bits_per_word() (diff)
downloadlinux-243f07be2423efe0b17e8ffafc9a36dad50406d3.tar.xz
linux-243f07be2423efe0b17e8ffafc9a36dad50406d3.zip
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/spi.c')
-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);