Skip to content

Commit e0ba736

Browse files
Uwe Kleine-Königandy-shev
authored andcommitted
pinctrl: cherryview: Convert to platform remove callback returning void
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>
1 parent d59b099 commit e0ba736

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,16 +1693,14 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
16931693
return 0;
16941694
}
16951695

1696-
static int chv_pinctrl_remove(struct platform_device *pdev)
1696+
static void chv_pinctrl_remove(struct platform_device *pdev)
16971697
{
16981698
struct intel_pinctrl *pctrl = platform_get_drvdata(pdev);
16991699
const struct intel_community *community = &pctrl->communities[0];
17001700

17011701
acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev),
17021702
community->acpi_space_id,
17031703
chv_pinctrl_mmio_access_handler);
1704-
1705-
return 0;
17061704
}
17071705

17081706
static int chv_pinctrl_suspend_noirq(struct device *dev)
@@ -1794,7 +1792,7 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match);
17941792

17951793
static struct platform_driver chv_pinctrl_driver = {
17961794
.probe = chv_pinctrl_probe,
1797-
.remove = chv_pinctrl_remove,
1795+
.remove_new = chv_pinctrl_remove,
17981796
.driver = {
17991797
.name = "cherryview-pinctrl",
18001798
.pm = pm_sleep_ptr(&chv_pinctrl_pm_ops),

0 commit comments

Comments
 (0)