Skip to contentSkip to conversation

usb: dwc3: keystone: Fix missing child after rebind

PATCH New Felix Gu 2 participants 2 messages Nov 22

Subsystems (2)
lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 usb: dwc3: keystone: Fix missing child after rebind

Directly unregistering the DWC3 child leaves OF_POPULATED set, preventing its recreation on rebind. Use of_platform_depopulate() to clear the population flags during removal.

Fixes 943befc314ae ("usb: dwc3: add Keystone specific glue layer")
---
 drivers/usb/dwc3/dwc3-keystone.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/usb/dwc3/dwc3-keystone.c +1 -10
index 7a5fc8545d4b..ee3da7945c87 100644
@@ -170,15 +170,6 @@ static int kdwc3_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int kdwc3_remove_core(struct device *dev, void *c)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-
-	platform_device_unregister(pdev);
-
-	return 0;
-}
-
 static void kdwc3_remove(struct platform_device *pdev)
 {
 	struct dwc3_keystone *kdwc = platform_get_drvdata(pdev);
@@ -187,7 +178,7 @@ static void kdwc3_remove(struct platform_device *pdev)
 	if (!of_device_is_compatible(node, "ti,am654-dwc3"))
 		kdwc3_disable_irqs(kdwc);
 
-	device_for_each_child(&pdev->dev, NULL, kdwc3_remove_core);
+	of_platform_depopulate(&pdev->dev);
 	pm_runtime_put_sync(kdwc->dev);
 	pm_runtime_disable(kdwc->dev);
 

---
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
change-id: 20261122-keystone-1-43327f3e1585

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 6 lines

Directly unregistering the DWC3 child leaves OF_POPULATED set, preventing its recreation on rebind. Use of_platform_depopulate() to clear the population flags during removal.

Fixes 943befc314ae ("usb: dwc3: add Keystone specific glue layer")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1