Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: asm9260: 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-6-u.kleine-koenig@pengutronix.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Uwe Kleine-König and committed by
Alexandre Belloni
ad01bf83 28015e79

+2 -3
+2 -3
drivers/rtc/rtc-asm9260.c
··· 308 308 return ret; 309 309 } 310 310 311 - static int asm9260_rtc_remove(struct platform_device *pdev) 311 + static void asm9260_rtc_remove(struct platform_device *pdev) 312 312 { 313 313 struct asm9260_rtc_priv *priv = platform_get_drvdata(pdev); 314 314 315 315 /* Disable alarm matching */ 316 316 iowrite32(BM_AMR_OFF, priv->iobase + HW_AMR); 317 317 clk_disable_unprepare(priv->clk); 318 - return 0; 319 318 } 320 319 321 320 static const struct of_device_id asm9260_dt_ids[] = { ··· 325 326 326 327 static struct platform_driver asm9260_rtc_driver = { 327 328 .probe = asm9260_rtc_probe, 328 - .remove = asm9260_rtc_remove, 329 + .remove_new = asm9260_rtc_remove, 329 330 .driver = { 330 331 .name = "asm9260-rtc", 331 332 .of_match_table = asm9260_dt_ids,