diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-10-20 12:28:29 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-10-21 13:27:37 +0100 |
commit | 243f07be2423efe0b17e8ffafc9a36dad50406d3 (patch) | |
tree | 9ea3ea58dbb9ca116b45e8a179b6faa3729df5fe /drivers/spi/spi.c | |
parent | 5ab8d262122bc951b308e51cdcc55bc67b1f5fdb (diff) |
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.c | 2 |
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); |