Commit 86527bcb authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: Rename enable1 to activate in spi_set_cs()

The enable1 is confusing name. Change it to clearly show what is
the intention behind it. No functional changes.

Fixes: 25093bde ("spi: implement SW control for CS times")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210420131846.75983-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9ec2a73f
...@@ -788,7 +788,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n) ...@@ -788,7 +788,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n)
static void spi_set_cs(struct spi_device *spi, bool enable, bool force) static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
{ {
bool enable1 = enable; bool activate = enable;
/* /*
* Avoid calling into the driver (or doing delays) if the chip select * Avoid calling into the driver (or doing delays) if the chip select
...@@ -803,7 +803,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force) ...@@ -803,7 +803,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
if (spi->cs_gpiod || gpio_is_valid(spi->cs_gpio) || if (spi->cs_gpiod || gpio_is_valid(spi->cs_gpio) ||
!spi->controller->set_cs_timing) { !spi->controller->set_cs_timing) {
if (enable1) if (activate)
spi_delay_exec(&spi->controller->cs_setup, NULL); spi_delay_exec(&spi->controller->cs_setup, NULL);
else else
spi_delay_exec(&spi->controller->cs_hold, NULL); spi_delay_exec(&spi->controller->cs_hold, NULL);
...@@ -816,8 +816,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force) ...@@ -816,8 +816,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
if (!(spi->mode & SPI_NO_CS)) { if (!(spi->mode & SPI_NO_CS)) {
if (spi->cs_gpiod) if (spi->cs_gpiod)
/* polarity handled by gpiolib */ /* polarity handled by gpiolib */
gpiod_set_value_cansleep(spi->cs_gpiod, gpiod_set_value_cansleep(spi->cs_gpiod, activate);
enable1);
else else
/* /*
* invert the enable line, as active low is * invert the enable line, as active low is
...@@ -835,7 +834,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force) ...@@ -835,7 +834,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
if (spi->cs_gpiod || gpio_is_valid(spi->cs_gpio) || if (spi->cs_gpiod || gpio_is_valid(spi->cs_gpio) ||
!spi->controller->set_cs_timing) { !spi->controller->set_cs_timing) {
if (!enable1) if (!activate)
spi_delay_exec(&spi->controller->cs_inactive, NULL); spi_delay_exec(&spi->controller->cs_inactive, NULL);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment