summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-gpio.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2013-11-24 09:37:01 -0300
committerMark Brown <broonie@linaro.org>2013-11-24 14:12:36 +0000
commitd9dda5a1917a01e6317f7bee81e7e6ed236d7e0a (patch)
tree9309119fa4547d6bb5d7301f916681cc565cc451 /drivers/spi/spi-gpio.c
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
downloadop-kernel-dev-d9dda5a1917a01e6317f7bee81e7e6ed236d7e0a.zip
op-kernel-dev-d9dda5a1917a01e6317f7bee81e7e6ed236d7e0a.tar.gz
spi: spi-gpio: Use 'cansleep' variants to access GPIO
The GPIO chip in use could be of any kind, and therefore might sleep when accesing the GPIO lines. Take account of this by using cansleep instead, which is the most generic case. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-gpio.c')
-rw-r--r--drivers/spi/spi-gpio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 3fb09f9..7beeb29 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -115,17 +115,17 @@ spi_to_pdata(const struct spi_device *spi)
static inline void setsck(const struct spi_device *spi, int is_on)
{
- gpio_set_value(SPI_SCK_GPIO, is_on);
+ gpio_set_value_cansleep(SPI_SCK_GPIO, is_on);
}
static inline void setmosi(const struct spi_device *spi, int is_on)
{
- gpio_set_value(SPI_MOSI_GPIO, is_on);
+ gpio_set_value_cansleep(SPI_MOSI_GPIO, is_on);
}
static inline int getmiso(const struct spi_device *spi)
{
- return !!gpio_get_value(SPI_MISO_GPIO);
+ return !!gpio_get_value_cansleep(SPI_MISO_GPIO);
}
#undef pdata
@@ -229,7 +229,7 @@ static void spi_gpio_chipselect(struct spi_device *spi, int is_active)
if (cs != SPI_GPIO_NO_CHIPSELECT) {
/* SPI is normally active-low */
- gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active);
+ gpio_set_value_cansleep(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active);
}
}
OpenPOWER on IntegriCloud