patch "usb: cdns3: imx: fix can't create core device the second time issue" added to usb-linus
Subsystems (4)
This is a note to let you know that I've just added the patch titled
usb: cdns3: imx: fix can't create core device the second time issue
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 2ef02b846ee2526249a562a66d6dcb25fcbca9d8 Mon Sep 17 00:00:00 2001
From: Peter Chen <[email protected]>
Date: Thu, 10 Dec 2020 21:31:37 +0800
Subject: 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.
--- drivers/usb/cdns3/cdns3-imx.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/usb/cdns3/cdns3-imx.c +1 -10
@@ -218,20 +218,11 @@ static int cdns_imx_probe(struct platform_device *pdev)return ret; } -static int cdns_imx_remove_core (struct device *dev,void *data) -{ -struct platform_device *pdev =to_platform_device (dev); - -platform_device_unregister (pdev); - -return 0 ; -} -static int cdns_imx_remove (struct platform_device *pdev) {struct device *dev = &pdev->dev; -device_for_each_child (dev,NULL , cdns_imx_remove_core); +of_platform_depopulate (dev);platform_set_drvdata (pdev,NULL );return 0 ;
Signature · 1 line
2.30.0