Skip to content

Commit f3e38da

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: ti-bandgap: 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 f021f05 commit f3e38da

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/ti-soc-thermal/ti-bandgap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ int ti_bandgap_probe(struct platform_device *pdev)
10691069
}
10701070

10711071
static
1072-
int ti_bandgap_remove(struct platform_device *pdev)
1072+
void ti_bandgap_remove(struct platform_device *pdev)
10731073
{
10741074
struct ti_bandgap *bgp = platform_get_drvdata(pdev);
10751075
int i;
@@ -1098,8 +1098,6 @@ int ti_bandgap_remove(struct platform_device *pdev)
10981098

10991099
if (TI_BANDGAP_HAS(bgp, TSHUT))
11001100
free_irq(gpiod_to_irq(bgp->tshut_gpiod), NULL);
1101-
1102-
return 0;
11031101
}
11041102

11051103
#ifdef CONFIG_PM_SLEEP
@@ -1283,7 +1281,7 @@ MODULE_DEVICE_TABLE(of, of_ti_bandgap_match);
12831281

12841282
static struct platform_driver ti_bandgap_sensor_driver = {
12851283
.probe = ti_bandgap_probe,
1286-
.remove = ti_bandgap_remove,
1284+
.remove_new = ti_bandgap_remove,
12871285
.driver = {
12881286
.name = "ti-soc-thermal",
12891287
.pm = DEV_PM_OPS,

0 commit comments

Comments
 (0)