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

HSI: omap_ssi_core: 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>
Link: https://lore.kernel.org/r/bc6b1caafa977346b33c1040d0f8e616bc0457bf.1712756364.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Uwe Kleine-König and committed by
Sebastian Reichel
94eabddc 4cece764

+2 -4
+2 -4
drivers/hsi/controllers/omap_ssi_core.c
··· 547 547 return err; 548 548 } 549 549 550 - static int ssi_remove(struct platform_device *pd) 550 + static void ssi_remove(struct platform_device *pd) 551 551 { 552 552 struct hsi_controller *ssi = platform_get_drvdata(pd); 553 553 ··· 561 561 platform_set_drvdata(pd, NULL); 562 562 563 563 pm_runtime_disable(&pd->dev); 564 - 565 - return 0; 566 564 } 567 565 568 566 #ifdef CONFIG_PM ··· 616 618 617 619 static struct platform_driver ssi_pdriver = { 618 620 .probe = ssi_probe, 619 - .remove = ssi_remove, 621 + .remove_new = ssi_remove, 620 622 .driver = { 621 623 .name = "omap_ssi", 622 624 .pm = DEV_PM_OPS,