Skip to content

Commit 94eabdd

Browse files
Uwe Kleine-Königsre
authored andcommitted
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>
1 parent 4cece76 commit 94eabdd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/hsi/controllers/omap_ssi_core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static int ssi_probe(struct platform_device *pd)
547547
return err;
548548
}
549549

550-
static int ssi_remove(struct platform_device *pd)
550+
static void ssi_remove(struct platform_device *pd)
551551
{
552552
struct hsi_controller *ssi = platform_get_drvdata(pd);
553553

@@ -561,8 +561,6 @@ static int ssi_remove(struct platform_device *pd)
561561
platform_set_drvdata(pd, NULL);
562562

563563
pm_runtime_disable(&pd->dev);
564-
565-
return 0;
566564
}
567565

568566
#ifdef CONFIG_PM
@@ -618,7 +616,7 @@ MODULE_DEVICE_TABLE(of, omap_ssi_of_match);
618616

619617
static struct platform_driver ssi_pdriver = {
620618
.probe = ssi_probe,
621-
.remove = ssi_remove,
619+
.remove_new = ssi_remove,
622620
.driver = {
623621
.name = "omap_ssi",
624622
.pm = DEV_PM_OPS,

0 commit comments

Comments
 (0)