rtc: sunplus: 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 (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/20230304133028.2135435-35-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
16324165ab
commit
d6f525040e
@ -304,15 +304,13 @@ free_clk:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sp_rtc_remove(struct platform_device *plat_dev)
|
||||
static void sp_rtc_remove(struct platform_device *plat_dev)
|
||||
{
|
||||
struct sunplus_rtc *sp_rtc = dev_get_drvdata(&plat_dev->dev);
|
||||
|
||||
device_init_wakeup(&plat_dev->dev, 0);
|
||||
reset_control_assert(sp_rtc->rstc);
|
||||
clk_disable_unprepare(sp_rtc->rtcclk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
@ -347,7 +345,7 @@ static SIMPLE_DEV_PM_OPS(sp_rtc_pm_ops, sp_rtc_suspend, sp_rtc_resume);
|
||||
|
||||
static struct platform_driver sp_rtc_driver = {
|
||||
.probe = sp_rtc_probe,
|
||||
.remove = sp_rtc_remove,
|
||||
.remove_new = sp_rtc_remove,
|
||||
.driver = {
|
||||
.name = "sp7021-rtc",
|
||||
.of_match_table = sp_rtc_of_match,
|
||||
|
Loading…
Reference in New Issue
Block a user