Skip to content

Commit 2ef02b8

Browse files
author
Peter Chen
committed
usb: cdns3: imx: fix can't create core device the second time issue
The cdns3 core device is populated by calling of_platform_populate, the flag OF_POPULATED is set for core device node, if this flag is not cleared, when calling of_platform_populate the second time after loading parent module again, the OF code will not try to create platform device for core device. To fix it, it uses of_platform_depopulate to depopulate the core device which the parent created, and the flag OF_POPULATED for core device node will be cleared accordingly. Cc: <[email protected]> Fixes: 1e056ef ("usb: cdns3: add NXP imx8qm glue layer") Signed-off-by: Peter Chen <[email protected]>
1 parent 92cbdb9 commit 2ef02b8

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/usb/cdns3/cdns3-imx.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,11 @@ static int cdns_imx_probe(struct platform_device *pdev)
218218
return ret;
219219
}
220220

221-
static int cdns_imx_remove_core(struct device *dev, void *data)
222-
{
223-
struct platform_device *pdev = to_platform_device(dev);
224-
225-
platform_device_unregister(pdev);
226-
227-
return 0;
228-
}
229-
230221
static int cdns_imx_remove(struct platform_device *pdev)
231222
{
232223
struct device *dev = &pdev->dev;
233224

234-
device_for_each_child(dev, NULL, cdns_imx_remove_core);
225+
of_platform_depopulate(dev);
235226
platform_set_drvdata(pdev, NULL);
236227

237228
return 0;

0 commit comments

Comments
 (0)