diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-10-20 05:28:29 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-10-21 08:27:37 -0400 |
commit | 243f07be2423efe0b17e8ffafc9a36dad50406d3 (patch) | |
tree | 9ea3ea58dbb9ca116b45e8a179b6faa3729df5fe | |
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>
-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) | |||
606 | if (spi->mode & SPI_CS_HIGH) | 606 | if (spi->mode & SPI_CS_HIGH) |
607 | enable = !enable; | 607 | enable = !enable; |
608 | 608 | ||
609 | if (spi->cs_gpio >= 0) | 609 | if (gpio_is_valid(spi->cs_gpio)) |
610 | gpio_set_value(spi->cs_gpio, !enable); | 610 | gpio_set_value(spi->cs_gpio, !enable); |
611 | else if (spi->master->set_cs) | 611 | else if (spi->master->set_cs) |
612 | spi->master->set_cs(spi, !enable); | 612 | spi->master->set_cs(spi, !enable); |