Skip to content

Commit 0a902f5

Browse files
Uwe Kleine-KönigJassiBrar
authored andcommitted
mailbox: stm32-ipcc: 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> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
1 parent d3a0021 commit 0a902f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mailbox/stm32-ipcc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,14 @@ static int stm32_ipcc_probe(struct platform_device *pdev)
331331
return ret;
332332
}
333333

334-
static int stm32_ipcc_remove(struct platform_device *pdev)
334+
static void stm32_ipcc_remove(struct platform_device *pdev)
335335
{
336336
struct device *dev = &pdev->dev;
337337

338338
if (of_property_read_bool(dev->of_node, "wakeup-source"))
339339
dev_pm_clear_wake_irq(&pdev->dev);
340340

341341
device_set_wakeup_capable(dev, false);
342-
343-
return 0;
344342
}
345343

346344
#ifdef CONFIG_PM_SLEEP
@@ -381,7 +379,7 @@ static struct platform_driver stm32_ipcc_driver = {
381379
.of_match_table = stm32_ipcc_of_match,
382380
},
383381
.probe = stm32_ipcc_probe,
384-
.remove = stm32_ipcc_remove,
382+
.remove_new = stm32_ipcc_remove,
385383
};
386384

387385
module_platform_driver(stm32_ipcc_driver);

0 commit comments

Comments
 (0)