]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: cherryview: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 9 Oct 2023 08:38:41 +0000 (10:38 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 11 Oct 2023 20:40:49 +0000 (23:40 +0300)
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 <u.kleine-koenig@pengutronix.de>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/pinctrl/intel/pinctrl-cherryview.c

index e2cb7cbd518714476d228ae28a99c3919b6f7cb2..5fde4fec59c176faa691cbc9c8915fbb429deeab 100644 (file)
@@ -1693,7 +1693,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int chv_pinctrl_remove(struct platform_device *pdev)
+static void chv_pinctrl_remove(struct platform_device *pdev)
 {
        struct intel_pinctrl *pctrl = platform_get_drvdata(pdev);
        const struct intel_community *community = &pctrl->communities[0];
@@ -1701,8 +1701,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev)
        acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev),
                                          community->acpi_space_id,
                                          chv_pinctrl_mmio_access_handler);
-
-       return 0;
 }
 
 static int chv_pinctrl_suspend_noirq(struct device *dev)
@@ -1794,7 +1792,7 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match);
 
 static struct platform_driver chv_pinctrl_driver = {
        .probe = chv_pinctrl_probe,
-       .remove = chv_pinctrl_remove,
+       .remove_new = chv_pinctrl_remove,
        .driver = {
                .name = "cherryview-pinctrl",
                .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops),