Skip to content

Commit 2128ba4

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: tsens: 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 <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 2d3c823 commit 2128ba4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/qcom/tsens.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,21 +1319,19 @@ static int tsens_probe(struct platform_device *pdev)
13191319
return ret;
13201320
}
13211321

1322-
static int tsens_remove(struct platform_device *pdev)
1322+
static void tsens_remove(struct platform_device *pdev)
13231323
{
13241324
struct tsens_priv *priv = platform_get_drvdata(pdev);
13251325

13261326
debugfs_remove_recursive(priv->debug_root);
13271327
tsens_disable_irq(priv);
13281328
if (priv->ops->disable)
13291329
priv->ops->disable(priv);
1330-
1331-
return 0;
13321330
}
13331331

13341332
static struct platform_driver tsens_driver = {
13351333
.probe = tsens_probe,
1336-
.remove = tsens_remove,
1334+
.remove_new = tsens_remove,
13371335
.driver = {
13381336
.name = "qcom-tsens",
13391337
.pm = &tsens_pm_ops,

0 commit comments

Comments
 (0)