]> Git Repo - J-linux.git/commitdiff
reset: rzg2l-usbphy-ctrl: Convert to platform remove callback returning void
authorUwe Kleine-König <[email protected]>
Tue, 5 Mar 2024 21:32:04 +0000 (22:32 +0100)
committerPhilipp Zabel <[email protected]>
Mon, 25 Mar 2024 09:14:03 +0000 (10:14 +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() will be 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 <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Link: https://lore.kernel.org/r/e75fb1af5c7df5fc4073a26a99ba88633503910d.1709674157.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Philipp Zabel <[email protected]>
drivers/reset/reset-rzg2l-usbphy-ctrl.c

index a8dde46063602dcc799db1e7bac5a3eef9fdf9e7..8f6fbd978591282ab9ae50a3732fdc296cb525d7 100644 (file)
@@ -156,15 +156,13 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int rzg2l_usbphy_ctrl_remove(struct platform_device *pdev)
+static void rzg2l_usbphy_ctrl_remove(struct platform_device *pdev)
 {
        struct rzg2l_usbphy_ctrl_priv *priv = dev_get_drvdata(&pdev->dev);
 
        pm_runtime_put(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
        reset_control_assert(priv->rstc);
-
-       return 0;
 }
 
 static struct platform_driver rzg2l_usbphy_ctrl_driver = {
@@ -173,7 +171,7 @@ static struct platform_driver rzg2l_usbphy_ctrl_driver = {
                .of_match_table = rzg2l_usbphy_ctrl_match_table,
        },
        .probe  = rzg2l_usbphy_ctrl_probe,
-       .remove = rzg2l_usbphy_ctrl_remove,
+       .remove_new = rzg2l_usbphy_ctrl_remove,
 };
 module_platform_driver(rzg2l_usbphy_ctrl_driver);
 
This page took 0.054758 seconds and 4 git commands to generate.