phy: motorola: phy-mapphone-mdm6600: Convert to platform remove callback returning...
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 7 Mar 2023 11:58:39 +0000 (12:58 +0100)
committerVinod Koul <vkoul@kernel.org>
Mon, 20 Mar 2023 12:44:56 +0000 (18:14 +0530)
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/20230307115900.2293120-11-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/motorola/phy-mapphone-mdm6600.c

index 3cd4d51c247c3cf2950dee85ec0233bb5742c7f9..1d567604b650d9449d0b07da821ac6907a15d4ca 100644 (file)
@@ -634,7 +634,7 @@ cleanup:
        return error;
 }
 
-static int phy_mdm6600_remove(struct platform_device *pdev)
+static void phy_mdm6600_remove(struct platform_device *pdev)
 {
        struct phy_mdm6600 *ddata = platform_get_drvdata(pdev);
        struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET];
@@ -653,13 +653,11 @@ static int phy_mdm6600_remove(struct platform_device *pdev)
        cancel_delayed_work_sync(&ddata->modem_wake_work);
        cancel_delayed_work_sync(&ddata->bootup_work);
        cancel_delayed_work_sync(&ddata->status_work);
-
-       return 0;
 }
 
 static struct platform_driver phy_mdm6600_driver = {
        .probe = phy_mdm6600_probe,
-       .remove = phy_mdm6600_remove,
+       .remove_new = phy_mdm6600_remove,
        .driver = {
                .name = "phy-mapphone-mdm6600",
                .pm = &phy_mdm6600_pm_ops,