Skip to contentSkip to conversation

gpiolib: Do not unexport GPIO on freeing

PATCH In review Andy Shevchenko 3 participants 3 messages Jun 5, 2023 – Jun 9, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpiolib: Do not unexport GPIO on freeing

Since the legacy exporting is gone with 2f804aca4832 ("gpiolib:
Kill unused GPIOF_EXPORT and Co") there is no need to unexport GPIO on freeing. Remove that call.

Note, the other users of this functionality do that explicitly, except one SH and one OMAP boardfile which don't free GPIO anyways, so it is safe to drop the call.

---
v2: mentioned OMAP boardfile as well

 drivers/gpio/gpiolib.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpiolib.c +0 -2
index a8da38ee721a..7a9c9934365a 100644
@@ -2117,8 +2117,6 @@ static bool gpiod_free_commit(struct gpio_desc *desc)
 
 	might_sleep();
 
-	gpiod_unexport(desc);
-
 	spin_lock_irqsave(&gpio_lock, flags);
 
 	gc = desc->gdev->chip;
Signature · 1 line
2.40.0.1.gaa8946217a0b
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Andy Shevchenko

Since the legacy exporting is gone with 2f804aca4832 ("gpiolib:
Kill unused GPIOF_EXPORT and Co") there is no need to unexport GPIO on freeing. Remove that call.

Note, the other users of this functionality do that explicitly, except one SH and one OMAP boardfile which don't free GPIO anyways, so it is safe to drop the call.

Yeah let's kill this off it is just annoying.

Yours,
Linus Walleij

#2 lore raw
In reply to Andy Shevchenko
Quoted 29 lines · Andy Shevchenko

Since the legacy exporting is gone with 2f804aca4832 ("gpiolib:
Kill unused GPIOF_EXPORT and Co") there is no need to unexport GPIO on freeing. Remove that call.

Note, the other users of this functionality do that explicitly, except one SH and one OMAP boardfile which don't free GPIO anyways, so it is safe to drop the call.

---
v2: mentioned OMAP boardfile as well

 drivers/gpio/gpiolib.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpiolib.c +0 -3
index a8da38ee721a..7a9c9934365a 100644
@@ -2117,8 +2117,6 @@ static bool gpiod_free_commit(struct gpio_desc *desc)
 
        might_sleep();
 
-       gpiod_unexport(desc);
-
        spin_lock_irqsave(&gpio_lock, flags);
 
        gc = desc->gdev->chip;
--
Quoted 2 lines

2.40.0.1.gaa8946217a0b

Ah, you already sent a v2. I applied this one.

Bart