]> www.infradead.org Git - linux.git/commitdiff
clk: samsung: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 12 Mar 2023 16:15:06 +0000 (17:15 +0100)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 12 Mar 2023 16:24:13 +0000 (17:24 +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 (mostly) ignored
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.

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>
Link: https://lore.kernel.org/r/20230312161512.2715500-25-u.kleine-koenig@pengutronix.de
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/clk/samsung/clk-exynos-audss.c
drivers/clk/samsung/clk-exynos-clkout.c

index 9cc127a162ad6a9330ff21e3756ee8ee20dbb5b8..7626dff41f6faec912146a9b8978564583073fb0 100644 (file)
@@ -268,7 +268,7 @@ unregister:
        return ret;
 }
 
-static int exynos_audss_clk_remove(struct platform_device *pdev)
+static void exynos_audss_clk_remove(struct platform_device *pdev)
 {
        of_clk_del_provider(pdev->dev.of_node);
 
@@ -277,8 +277,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 
        if (!IS_ERR(epll))
                clk_disable_unprepare(epll);
-
-       return 0;
 }
 
 static const struct dev_pm_ops exynos_audss_clk_pm_ops = {
@@ -295,7 +293,7 @@ static struct platform_driver exynos_audss_clk_driver = {
                .pm = &exynos_audss_clk_pm_ops,
        },
        .probe = exynos_audss_clk_probe,
-       .remove = exynos_audss_clk_remove,
+       .remove_new = exynos_audss_clk_remove,
 };
 
 module_platform_driver(exynos_audss_clk_driver);
index e6d6cbf8c4e61e5d7d1c7edc653d27a0a995ed78..0cff1c94c35e67ae72f329dc24c86e04a6cb9d91 100644 (file)
@@ -196,15 +196,13 @@ clks_put:
        return ret;
 }
 
-static int exynos_clkout_remove(struct platform_device *pdev)
+static void exynos_clkout_remove(struct platform_device *pdev)
 {
        struct exynos_clkout *clkout = platform_get_drvdata(pdev);
 
        of_clk_del_provider(clkout->np);
        clk_hw_unregister(clkout->data.hws[0]);
        iounmap(clkout->reg);
-
-       return 0;
 }
 
 static int __maybe_unused exynos_clkout_suspend(struct device *dev)
@@ -235,7 +233,7 @@ static struct platform_driver exynos_clkout_driver = {
                .pm = &exynos_clkout_pm_ops,
        },
        .probe = exynos_clkout_probe,
-       .remove = exynos_clkout_remove,
+       .remove_new = exynos_clkout_remove,
 };
 module_platform_driver(exynos_clkout_driver);