]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: dwc3-exynos: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 17 May 2023 23:01:16 +0000 (01:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 May 2023 11:36:23 +0000 (12:36 +0100)
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart from
emitting a warning) and this typically results in resource leaks. To improve
here there is a quest to make the remove callback return void. In the first
step of this quest all drivers are converted to .remove_new() which already
returns void. Eventually after all drivers are converted, .remove_new() is
renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20230517230239.187727-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-exynos.c

index 4be6a873bd07166d1c3ed9bbe88f78417e8c0498..f882dd6473403e4c2f1bc93e1409d07e88e90a25 100644 (file)
@@ -128,7 +128,7 @@ vdd33_err:
        return ret;
 }
 
-static int dwc3_exynos_remove(struct platform_device *pdev)
+static void dwc3_exynos_remove(struct platform_device *pdev)
 {
        struct dwc3_exynos      *exynos = platform_get_drvdata(pdev);
        int i;
@@ -143,8 +143,6 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
 
        regulator_disable(exynos->vdd33);
        regulator_disable(exynos->vdd10);
-
-       return 0;
 }
 
 static const struct dwc3_exynos_driverdata exynos5250_drvdata = {
@@ -234,7 +232,7 @@ static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = {
 
 static struct platform_driver dwc3_exynos_driver = {
        .probe          = dwc3_exynos_probe,
-       .remove         = dwc3_exynos_remove,
+       .remove_new     = dwc3_exynos_remove,
        .driver         = {
                .name   = "exynos-dwc3",
                .of_match_table = exynos_dwc3_match,