public inbox for stable@vger.kernel.org
 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
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ 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] 10+ 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
  2026-01-09 16:37 ` Lee Jones
  2026-01-20 15:10 ` (subset) " Lee Jones
  2 siblings, 0 replies; 10+ 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] 10+ 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
@ 2026-01-09 16:37 ` Lee Jones
  2026-01-09 16:39   ` Lee Jones
  2026-01-13  9:37   ` Johan Hovold
  2026-01-20 15:10 ` (subset) " Lee Jones
  2 siblings, 2 replies; 10+ messages in thread
From: Lee Jones @ 2026-01-09 16:37 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 19 Dec 2025, Johan Hovold 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>
> ---
>  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);

devm_of_platform_populate()?

> +	else
> +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);

What on earth is this driver even doing in MFD?

Nightmare - quick dig, bury it!

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2026-01-09 16:37 ` Lee Jones
@ 2026-01-09 16:39   ` Lee Jones
  2026-01-09 17:18     ` Andreas Kemnade
  2026-01-13  9:37   ` Johan Hovold
  1 sibling, 1 reply; 10+ messages in thread
From: Lee Jones @ 2026-01-09 16:39 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 09 Jan 2026, Lee Jones wrote:

> On Fri, 19 Dec 2025, Johan Hovold 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>
> > ---
> >  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);
> 
> devm_of_platform_populate()?
> 
> > +	else
> > +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
> 
> What on earth is this driver even doing in MFD?
> 
> Nightmare - quick dig, bury it!

Is the old platform method even supported anymore?

$ git grep \"usbhs_omap\""
drivers/mfd/omap-usb-host.c:#define USBHS_DRIVER_NAME   "usbhs_omap"

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2026-01-09 16:39   ` Lee Jones
@ 2026-01-09 17:18     ` Andreas Kemnade
  2026-01-09 17:37       ` Andreas Kemnade
  2026-01-09 17:43       ` Lee Jones
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Kemnade @ 2026-01-09 17:18 UTC (permalink / raw)
  To: Lee Jones
  Cc: Johan Hovold, Aaro Koskinen, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 9 Jan 2026 16:39:39 +0000
Lee Jones <lee@kernel.org> wrote:

> On Fri, 09 Jan 2026, Lee Jones wrote:
> 
> > On Fri, 19 Dec 2025, Johan Hovold 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>
> > > ---
> > >  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);  
> > 
> > devm_of_platform_populate()?
> >   
> > > +	else
> > > +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);  
> > 
> > What on earth is this driver even doing in MFD?
> > 
> > Nightmare - quick dig, bury it!  
> 
> Is the old platform method even supported anymore?
> 
> $ git grep \"usbhs_omap\""
> drivers/mfd/omap-usb-host.c:#define USBHS_DRIVER_NAME   "usbhs_omap"
> 
:~/linux/arch/arm/boot/dts/ti/omap$ grep ti,usbhs-host *.dtsi
omap3.dtsi:			compatible = "ti,usbhs-host";
omap4-l4.dtsi:				compatible = "ti,usbhs-host";
omap5-l4.dtsi:				compatible = "ti,usbhs-host";

So it is still in use.

Regards,
Andreas

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

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2026-01-09 17:18     ` Andreas Kemnade
@ 2026-01-09 17:37       ` Andreas Kemnade
  2026-01-09 17:49         ` Lee Jones
  2026-01-09 17:43       ` Lee Jones
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Kemnade @ 2026-01-09 17:37 UTC (permalink / raw)
  To: Lee Jones
  Cc: Johan Hovold, Aaro Koskinen, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 9 Jan 2026 18:18:39 +0100
Andreas Kemnade <andreas@kemnade.info> wrote:

> On Fri, 9 Jan 2026 16:39:39 +0000
> Lee Jones <lee@kernel.org> wrote:
> 
> > On Fri, 09 Jan 2026, Lee Jones wrote:
> >   
> > > On Fri, 19 Dec 2025, Johan Hovold 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>
> > > > ---
> > > >  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);    
> > > 
> > > devm_of_platform_populate()?
> > >     
> > > > +	else
> > > > +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);    
> > > 
> > > What on earth is this driver even doing in MFD?
> > > 
> > > Nightmare - quick dig, bury it!    
> > 
> > Is the old platform method even supported anymore?
> > 
> > $ git grep \"usbhs_omap\""
> > drivers/mfd/omap-usb-host.c:#define USBHS_DRIVER_NAME   "usbhs_omap"
> >   
> :~/linux/arch/arm/boot/dts/ti/omap$ grep ti,usbhs-host *.dtsi
> omap3.dtsi:			compatible = "ti,usbhs-host";
> omap4-l4.dtsi:				compatible = "ti,usbhs-host";
> omap5-l4.dtsi:				compatible = "ti,usbhs-host";
> 
> So it is still in use.
> 
ok, that was just answering in panic mode to prevent removal of a needed
driver. Reading it again: I think omap2/3/4/5 without devicetree will not work
anyway, so we can remove anything done on !dev->of_node.

Regards,
Andreas

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

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2026-01-09 17:18     ` Andreas Kemnade
  2026-01-09 17:37       ` Andreas Kemnade
@ 2026-01-09 17:43       ` Lee Jones
  1 sibling, 0 replies; 10+ messages in thread
From: Lee Jones @ 2026-01-09 17:43 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Johan Hovold, Aaro Koskinen, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 09 Jan 2026, Andreas Kemnade wrote:

> On Fri, 9 Jan 2026 16:39:39 +0000
> Lee Jones <lee@kernel.org> wrote:
> 
> > On Fri, 09 Jan 2026, Lee Jones wrote:
> > 
> > > On Fri, 19 Dec 2025, Johan Hovold 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>
> > > > ---
> > > >  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);  
> > > 
> > > devm_of_platform_populate()?
> > >   
> > > > +	else
> > > > +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);  
> > > 
> > > What on earth is this driver even doing in MFD?
> > > 
> > > Nightmare - quick dig, bury it!  
> > 
> > Is the old platform method even supported anymore?
> > 
> > $ git grep \"usbhs_omap\""
> > drivers/mfd/omap-usb-host.c:#define USBHS_DRIVER_NAME   "usbhs_omap"
> > 
> :~/linux/arch/arm/boot/dts/ti/omap$ grep ti,usbhs-host *.dtsi
> omap3.dtsi:			compatible = "ti,usbhs-host";
> omap4-l4.dtsi:				compatible = "ti,usbhs-host";
> omap5-l4.dtsi:				compatible = "ti,usbhs-host";

That's the new "DT" method.

What about the old "usbhs_omap" one?

Looks to me like support was removed by Tony in 2016:

  9080b8dc761a ("ARM: OMAP2+: Remove legacy usb-host.c platform init code")

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2026-01-09 17:37       ` Andreas Kemnade
@ 2026-01-09 17:49         ` Lee Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2026-01-09 17:49 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Johan Hovold, Aaro Koskinen, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 09 Jan 2026, Andreas Kemnade wrote:

> On Fri, 9 Jan 2026 18:18:39 +0100
> Andreas Kemnade <andreas@kemnade.info> wrote:
> 
> > On Fri, 9 Jan 2026 16:39:39 +0000
> > Lee Jones <lee@kernel.org> wrote:
> > 
> > > On Fri, 09 Jan 2026, Lee Jones wrote:
> > >   
> > > > On Fri, 19 Dec 2025, Johan Hovold 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>
> > > > > ---
> > > > >  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);    
> > > > 
> > > > devm_of_platform_populate()?
> > > >     
> > > > > +	else
> > > > > +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);    
> > > > 
> > > > What on earth is this driver even doing in MFD?
> > > > 
> > > > Nightmare - quick dig, bury it!    
> > > 
> > > Is the old platform method even supported anymore?
> > > 
> > > $ git grep \"usbhs_omap\""
> > > drivers/mfd/omap-usb-host.c:#define USBHS_DRIVER_NAME   "usbhs_omap"
> > >   
> > :~/linux/arch/arm/boot/dts/ti/omap$ grep ti,usbhs-host *.dtsi
> > omap3.dtsi:			compatible = "ti,usbhs-host";
> > omap4-l4.dtsi:				compatible = "ti,usbhs-host";
> > omap5-l4.dtsi:				compatible = "ti,usbhs-host";
> > 
> > So it is still in use.
> > 
> ok, that was just answering in panic mode to prevent removal of a needed
> driver. Reading it again: I think omap2/3/4/5 without devicetree will not work
> anyway, so we can remove anything done on !dev->of_node.

Okay, leave it with me.

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH] mfd: omap-usb-host: fix OF populate on driver rebind
  2026-01-09 16:37 ` Lee Jones
  2026-01-09 16:39   ` Lee Jones
@ 2026-01-13  9:37   ` Johan Hovold
  1 sibling, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2026-01-13  9:37 UTC (permalink / raw)
  To: Lee Jones
  Cc: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, Jan 09, 2026 at 04:37:25PM +0000, Lee Jones wrote:
> On Fri, 19 Dec 2025, Johan Hovold 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>

> > @@ -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);
> 
> devm_of_platform_populate()?

Looks like that would work here, but I prefer using explicit removal for
both the OF and non-OF for symmetry and readability reasons.

If you think that the non-OF support can be removed then a devres
conversion can be done as part of that change.

> > +	else
> > +		device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);

Johan

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

* Re: (subset) [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
  2026-01-09 16:37 ` Lee Jones
@ 2026-01-20 15:10 ` Lee Jones
  2 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2026-01-20 15:10 UTC (permalink / raw)
  To: Lee Jones, Johan Hovold
  Cc: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, linux-omap, linux-kernel, stable

On Fri, 19 Dec 2025 12:07:14 +0100, Johan Hovold 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.
> 
> [...]

Applied, thanks!

[1/1] mfd: omap-usb-host: fix OF populate on driver rebind
      commit: 74283e1c49dd2d56e83bca070c163c56375c057d

--
Lee Jones [李琼斯]


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

end of thread, other threads:[~2026-01-20 15:10 UTC | newest]

Thread overview: 10+ 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
2026-01-09 16:37 ` Lee Jones
2026-01-09 16:39   ` Lee Jones
2026-01-09 17:18     ` Andreas Kemnade
2026-01-09 17:37       ` Andreas Kemnade
2026-01-09 17:49         ` Lee Jones
2026-01-09 17:43       ` Lee Jones
2026-01-13  9:37   ` Johan Hovold
2026-01-20 15:10 ` (subset) " Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox