Skip to content

Commit c076486

Browse files
Uwe Kleine-Königsre
authored andcommitted
HSI: omap_ssi_port: 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/11e06f4cce041436bd63fb24361f3cee06bd2d59.1712756364.git.u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 94eabdd commit c076486

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/hsi/controllers/omap_ssi_port.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ static int ssi_port_probe(struct platform_device *pd)
12241224
return err;
12251225
}
12261226

1227-
static int ssi_port_remove(struct platform_device *pd)
1227+
static void ssi_port_remove(struct platform_device *pd)
12281228
{
12291229
struct hsi_port *port = platform_get_drvdata(pd);
12301230
struct omap_ssi_port *omap_port = hsi_port_drvdata(port);
@@ -1251,8 +1251,6 @@ static int ssi_port_remove(struct platform_device *pd)
12511251

12521252
pm_runtime_dont_use_autosuspend(&pd->dev);
12531253
pm_runtime_disable(&pd->dev);
1254-
1255-
return 0;
12561254
}
12571255

12581256
static int ssi_restore_divisor(struct omap_ssi_port *omap_port)
@@ -1387,7 +1385,7 @@ MODULE_DEVICE_TABLE(of, omap_ssi_port_of_match);
13871385

13881386
struct platform_driver ssi_port_pdriver = {
13891387
.probe = ssi_port_probe,
1390-
.remove = ssi_port_remove,
1388+
.remove_new = ssi_port_remove,
13911389
.driver = {
13921390
.name = "omap_ssi_port",
13931391
.of_match_table = omap_ssi_port_of_match,

0 commit comments

Comments
 (0)