Skip to content

Commit e0481e5

Browse files
mszyprowgregkh
authored andcommitted
usb: dwc3: exynos: Fix remove() function
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: adcf20d ("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>
1 parent b25264f commit e0481e5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/usb/dwc3/dwc3-exynos.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ struct dwc3_exynos {
3737
struct regulator *vdd10;
3838
};
3939

40-
static int dwc3_exynos_remove_child(struct device *dev, void *unused)
41-
{
42-
struct platform_device *pdev = to_platform_device(dev);
43-
44-
platform_device_unregister(pdev);
45-
46-
return 0;
47-
}
48-
4940
static int dwc3_exynos_probe(struct platform_device *pdev)
5041
{
5142
struct dwc3_exynos *exynos;
@@ -142,7 +133,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
142133
struct dwc3_exynos *exynos = platform_get_drvdata(pdev);
143134
int i;
144135

145-
device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child);
136+
of_platform_depopulate(&pdev->dev);
146137

147138
for (i = exynos->num_clks - 1; i >= 0; i--)
148139
clk_disable_unprepare(exynos->clks[i]);

0 commit comments

Comments
 (0)