Skip to content

Commit 2a9090b

Browse files
Bartosz Golaszewskigregkh
authored andcommitted
gpio: of: clear OF_POPULATED on hog nodes in remove path
commit bbee90e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent adc8f91 commit 2a9090b

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
@@ -1196,5 +1196,12 @@ int of_gpiochip_add(struct gpio_chip *chip)
11961196

11971197
void of_gpiochip_remove(struct gpio_chip *chip)
11981198
{
1199-
of_node_put(dev_of_node(&chip->gpiodev->dev));
1199+
struct device_node *np = dev_of_node(&chip->gpiodev->dev);
1200+
1201+
for_each_child_of_node_scoped(np, child) {
1202+
if (of_property_present(child, "gpio-hog"))
1203+
of_node_clear_flag(child, OF_POPULATED);
1204+
}
1205+
1206+
of_node_put(np);
12001207
}

0 commit comments

Comments
 (0)