Skip to content

Commit 56e337f

Browse files
brgltorvalds
authored andcommitted
Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)"
This reverts commit fc328a7. This commit - while attempting to fix a regression - has caused a number of other problems. As the fallout from it is more significant than the initial problem itself, revert it for now before we find a correct solution. Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/stable/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Bartosz Golaszewski <[email protected]> Reported-and-bisected-by: Guenter Roeck <[email protected]> Reported-by: Michael Walle <[email protected]> Cc: Thorsten Leemhuis <[email protected]> Cc: Marcelo Roberto Jimenez <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6665ca1 commit 56e337f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpio/gpiolib.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,11 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gc)
17011701
*/
17021702
int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset)
17031703
{
1704+
#ifdef CONFIG_PINCTRL
1705+
if (list_empty(&gc->gpiodev->pin_ranges))
1706+
return 0;
1707+
#endif
1708+
17041709
return pinctrl_gpio_request(gc->gpiodev->base + offset);
17051710
}
17061711
EXPORT_SYMBOL_GPL(gpiochip_generic_request);
@@ -1712,6 +1717,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request);
17121717
*/
17131718
void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset)
17141719
{
1720+
#ifdef CONFIG_PINCTRL
1721+
if (list_empty(&gc->gpiodev->pin_ranges))
1722+
return;
1723+
#endif
1724+
17151725
pinctrl_gpio_free(gc->gpiodev->base + offset);
17161726
}
17171727
EXPORT_SYMBOL_GPL(gpiochip_generic_free);

0 commit comments

Comments
 (0)