All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: exynos: Fix remove() function
       [not found] <CGME20221108214300eucas1p22140957c56a1cf2f5203e171118e3d0b@eucas1p2.samsung.com>
@ 2022-11-08 21:42 ` Marek Szyprowski
  2022-11-09  0:33   ` Thinh Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Szyprowski @ 2022-11-08 21:42 UTC (permalink / raw)
  To: linux-usb, linux-samsung-soc
  Cc: Marek Szyprowski, Thinh Nguyen, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Alim Akhtar

The core DWC3 device node was not properly removed by the custom
dwc3_exynos_remove_child() function. Replace it with generic
of_platform_depopulate() which does that job right.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/usb/dwc3/dwc3-exynos.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index 0ecf20eeceee..4be6a873bd07 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -37,15 +37,6 @@ struct dwc3_exynos {
 	struct regulator	*vdd10;
 };
 
-static int dwc3_exynos_remove_child(struct device *dev, void *unused)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-
-	platform_device_unregister(pdev);
-
-	return 0;
-}
-
 static int dwc3_exynos_probe(struct platform_device *pdev)
 {
 	struct dwc3_exynos	*exynos;
@@ -142,7 +133,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
 	struct dwc3_exynos	*exynos = platform_get_drvdata(pdev);
 	int i;
 
-	device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);
+	of_platform_depopulate(&pdev->dev);
 
 	for (i = exynos->num_clks - 1; i >= 0; i--)
 		clk_disable_unprepare(exynos->clks[i]);
-- 
2.17.1


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

* Re: [PATCH] usb: dwc3: exynos: Fix remove() function
  2022-11-08 21:42 ` [PATCH] usb: dwc3: exynos: Fix remove() function Marek Szyprowski
@ 2022-11-09  0:33   ` Thinh Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Thinh Nguyen @ 2022-11-09  0:33 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-usb, linux-samsung-soc, Thinh Nguyen, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Alim Akhtar

On Tue, Nov 08, 2022, Marek Szyprowski wrote:
> The core DWC3 device node was not properly removed by the custom
> dwc3_exynos_remove_child() function. Replace it with generic
> of_platform_depopulate() which does that job right.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/usb/dwc3/dwc3-exynos.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index 0ecf20eeceee..4be6a873bd07 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -37,15 +37,6 @@ struct dwc3_exynos {
>  	struct regulator	*vdd10;
>  };
>  
> -static int dwc3_exynos_remove_child(struct device *dev, void *unused)
> -{
> -	struct platform_device *pdev = to_platform_device(dev);
> -
> -	platform_device_unregister(pdev);
> -
> -	return 0;
> -}
> -
>  static int dwc3_exynos_probe(struct platform_device *pdev)
>  {
>  	struct dwc3_exynos	*exynos;
> @@ -142,7 +133,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
>  	struct dwc3_exynos	*exynos = platform_get_drvdata(pdev);
>  	int i;
>  
> -	device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);
> +	of_platform_depopulate(&pdev->dev);
>  
>  	for (i = exynos->num_clks - 1; i >= 0; i--)
>  		clk_disable_unprepare(exynos->clks[i]);
> -- 
> 2.17.1
> 

Can you add Fixes tag and possibly Cc stable?

After adding the tags, you can add my Ack:
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

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

end of thread, other threads:[~2022-11-09  0:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20221108214300eucas1p22140957c56a1cf2f5203e171118e3d0b@eucas1p2.samsung.com>
2022-11-08 21:42 ` [PATCH] usb: dwc3: exynos: Fix remove() function Marek Szyprowski
2022-11-09  0:33   ` Thinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.