spi: pxa2xx: Use gpiod_put() not gpiod_free()

Message ID 20171222161755.2742-1-broonie@kernel.org
State Accepted
Commit a885eebc1b062c6a6a925db85828108779fb0e62
Headers show
Series
  • spi: pxa2xx: Use gpiod_put() not gpiod_free()
Related show

Commit Message

Mark Brown Dec. 22, 2017, 4:17 p.m.
gpiod_free() is an internal function for gpiolib, gpiod_put() is the
correct external function.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>

---
 drivers/spi/spi-pxa2xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Geert Uytterhoeven Dec. 23, 2017, 9:01 a.m. | #1
Hi Mark,

On Fri, Dec 22, 2017 at 5:17 PM, Mark Brown <broonie@kernel.org> wrote:
> gpiod_free() is an internal function for gpiolib, gpiod_put() is the

> correct external function.

>

> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>

> Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

> Signed-off-by: Mark Brown <broonie@kernel.org>


Given you usually don't rebase spi/for-next:
Fixes: 221886646f75964c ("spi: pxa2xx: avoid redundant
gpio_to_desc(desc_to_gpio()) round-trip")

Else we may have to repeat the exercise for stable later ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index c209dc1047b5..b0822d1dba29 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -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) {
-		gpiod_free(chip->gpiod_cs);
+		gpiod_put(chip->gpiod_cs);
 		chip->gpiod_cs = NULL;
 	}
 
@@ -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)
-		gpiod_free(chip->gpiod_cs);
+		gpiod_put(chip->gpiod_cs);
 
 	kfree(chip);
 }