mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
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>
This commit is contained in:
parent
d59b099c66
commit
e0ba7366a6
1 changed files with 2 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue