stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
@ 2025-12-19 11:07 Johan Hovold
  2025-12-29 15:04 ` Andreas Kemnade
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2025-12-19 11:07 UTC (permalink / raw)
  To: Lee Jones
  Cc: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, Johan Hovold, stable

Since commit c6e126de43e7 ("of: Keep track of populated platform
devices") child devices will not be created by of_platform_populate()
if the devices had previously been deregistered individually so that the
OF_POPULATED flag is still set in the corresponding OF nodes.

Switch to using of_platform_depopulate() instead of open coding so that
the child devices are created if the driver is rebound.

Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
Cc: stable@vger.kernel.org	# 3.16
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/mfd/omap-usb-host.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index a77b6fc790f2..4d29a6e2ed87 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -819,8 +819,10 @@ static void usbhs_omap_remove(struct platform_device *pdev)
 {
 	pm_runtime_disable(&pdev->dev);
 
-	/* remove children */
-	device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
+	if (pdev->dev.of_node)
+		of_platform_depopulate(&pdev->dev);
+	else
+		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
 }
 
 static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2025-12-19 11:07 [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind Johan Hovold
@ 2025-12-29 15:04 ` Andreas Kemnade
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Kemnade @ 2025-12-29 15:04 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Lee Jones, Aaro Koskinen, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 19 Dec 2025 12:07:14 +0100
Johan Hovold <johan@kernel.org> wrote:

> Since commit c6e126de43e7 ("of: Keep track of populated platform
> devices") child devices will not be created by of_platform_populate()
> if the devices had previously been deregistered individually so that the
> OF_POPULATED flag is still set in the corresponding OF nodes.
> 
> Switch to using of_platform_depopulate() instead of open coding so that
> the child devices are created if the driver is rebound.
> 
> Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
> Cc: stable@vger.kernel.org	# 3.16
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Andreas Kemnade <andreas@kemnade.info>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-29 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19 11:07 [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind Johan Hovold
2025-12-29 15:04 ` Andreas Kemnade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).