usb: dwc3: exynos: Fix remove() function
commit e0481e5b3cc12ea7ccf4552d41518c89d3509004 upstream.
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.
Fixes: adcf20dcd2
("usb: dwc3: exynos: Use of_platform API to create dwc3 core pdev")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: stable@vger.kernel.org
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Link: https://lore.kernel.org/r/20221110154131.2577-1-m.szyprowski@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
d21d26e65b
commit
350e98a08a
@@ -37,15 +37,6 @@ struct dwc3_exynos {
|
|||||||
struct regulator *vdd10;
|
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)
|
static int dwc3_exynos_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct dwc3_exynos *exynos;
|
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);
|
struct dwc3_exynos *exynos = platform_get_drvdata(pdev);
|
||||||
int i;
|
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--)
|
for (i = exynos->num_clks - 1; i >= 0; i--)
|
||||||
clk_disable_unprepare(exynos->clks[i]);
|
clk_disable_unprepare(exynos->clks[i]);
|
||||||
|
Reference in New Issue
Block a user