Skip to content

Commit 740ad6d

Browse files
Uwe Kleine-Königlag-linaro
authored andcommitted
mfd: ti_am335x_tscadc: 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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent eea669c commit 740ad6d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mfd/ti_am335x_tscadc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)
298298
return err;
299299
}
300300

301-
static int ti_tscadc_remove(struct platform_device *pdev)
301+
static void ti_tscadc_remove(struct platform_device *pdev)
302302
{
303303
struct ti_tscadc_dev *tscadc = platform_get_drvdata(pdev);
304304

@@ -308,8 +308,6 @@ static int ti_tscadc_remove(struct platform_device *pdev)
308308
pm_runtime_disable(&pdev->dev);
309309

310310
mfd_remove_devices(tscadc->dev);
311-
312-
return 0;
313311
}
314312

315313
static int __maybe_unused ti_tscadc_can_wakeup(struct device *dev, void *data)
@@ -381,7 +379,7 @@ static struct platform_driver ti_tscadc_driver = {
381379
.of_match_table = ti_tscadc_dt_ids,
382380
},
383381
.probe = ti_tscadc_probe,
384-
.remove = ti_tscadc_remove,
382+
.remove_new = ti_tscadc_remove,
385383

386384
};
387385

0 commit comments

Comments
 (0)