Skip to contentSkip to conversation

FAILED: patch "[PATCH] gpio: of: clear OF_POPULATED on hog nodes in remove path" failed to apply to 6.1-stable tree

PATCH [email protected] 1 participant 1 message May 12

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x bbee90e750262bfb406d66dc65c46d616d2b6673
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026051256-bush-driver-5c12@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From bbee90e750262bfb406d66dc65c46d616d2b6673 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <[email protected]>
Date: Mon, 9 Mar 2026 13:42:37 +0100
Subject: [PATCH] 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.

drivers/gpio/gpiolib-of.c +8 -1
index c512d735e85f..b5610a847e72 100644
@@ -1187,7 +1187,14 @@ int of_gpiochip_add(struct gpio_chip *chip)
 
 void of_gpiochip_remove(struct gpio_chip *chip)
 {
-	of_node_put(dev_of_node(&chip->gpiodev->dev));
+	struct device_node *np = dev_of_node(&chip->gpiodev->dev);
+
+	for_each_child_of_node_scoped(np, child) {
+		if (of_property_present(child, "gpio-hog"))
+			of_node_clear_flag(child, OF_POPULATED);
+	}
+
+	of_node_put(np);
 }
 
 bool of_gpiochip_instance_match(struct gpio_chip *gc, unsigned int index)