Skip to content

Commit bbee90e

Browse files
author
Bartosz Golaszewski
committed
gpio: of: clear OF_POPULATED on hog nodes in remove path
The previously set OF_POPULATED flag should be cleared on the hog nodes when removing the chip. Cc: stable@vger.kernel.org Fixes: 63636d9 ("gpio: of: Add DT overlay support for GPIO hogs") Acked-by: Linus Walleij <linusw@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260309-gpio-hog-fwnode-v2-1-4e61f3dbf06a@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent bf01730 commit bbee90e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/gpio/gpiolib-of.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,14 @@ int of_gpiochip_add(struct gpio_chip *chip)
11871187

11881188
void of_gpiochip_remove(struct gpio_chip *chip)
11891189
{
1190-
of_node_put(dev_of_node(&chip->gpiodev->dev));
1190+
struct device_node *np = dev_of_node(&chip->gpiodev->dev);
1191+
1192+
for_each_child_of_node_scoped(np, child) {
1193+
if (of_property_present(child, "gpio-hog"))
1194+
of_node_clear_flag(child, OF_POPULATED);
1195+
}
1196+
1197+
of_node_put(np);
11911198
}
11921199

11931200
bool of_gpiochip_instance_match(struct gpio_chip *gc, unsigned int index)

0 commit comments

Comments
 (0)