This is a note to let you know that I've just added the patch titled usb: dwc3: exynos: Fix remove() function to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-dwc3-exynos-fix-remove-function.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit e18eb4eb88c815ba06bc291da056ba55580bda1e Author: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Date: Thu Nov 10 16:41:31 2022 +0100 usb: dwc3: exynos: Fix remove() function [ Upstream commit e0481e5b3cc12ea7ccf4552d41518c89d3509004 ] 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: adcf20dcd262 ("usb: dwc3: exynos: Use of_platform API to create dwc3 core pdev") Signed-off-by: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Acked-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Sam Protsenko <semen.protsenko@xxxxxxxxxx> Link: https://lore.kernel.org/r/20221110154131.2577-1-m.szyprowski@xxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 0a946c66c3bb..3d466ec8f8cc 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -28,15 +28,6 @@ struct dwc3_exynos { 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) { struct dwc3_exynos *exynos; @@ -136,7 +127,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev) { struct dwc3_exynos *exynos = platform_get_drvdata(pdev); - device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); + of_platform_depopulate(&pdev->dev); clk_disable_unprepare(exynos->axius_clk); clk_disable_unprepare(exynos->susp_clk);