Skip to content

Commit

Permalink
spi: pxa2xx: avoid redundant gpio_to_desc(desc_to_gpio()) round-trip
Browse files Browse the repository at this point in the history
gpio_free(gpio) simply does gpiod_free(gpio_to_desc(gpio)), so it's
simpler and cleaner to use gpiod_free directly.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Rasmus Villemoes authored and Mark Brown committed Dec 21, 2017
1 parent 4fbd8d1 commit 2218866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ static int setup_cs(struct spi_device *spi, struct chip_data *chip,
* different chip_info, release previously requested GPIO
*/
if (chip->gpiod_cs) {
gpio_free(desc_to_gpio(chip->gpiod_cs));
gpiod_free(chip->gpiod_cs);
chip->gpiod_cs = NULL;
}

Expand Down Expand Up @@ -1417,7 +1417,7 @@ static void cleanup(struct spi_device *spi)

if (drv_data->ssp_type != CE4100_SSP && !drv_data->cs_gpiods &&
chip->gpiod_cs)
gpio_free(desc_to_gpio(chip->gpiod_cs));
gpiod_free(chip->gpiod_cs);

kfree(chip);
}
Expand Down

0 comments on commit 2218866

Please sign in to comment.