Skip to content

Commit 3c9e0f2

Browse files
Uwe Kleine-Königrafaeljw
authored andcommitted
thermal: k3_j72xx_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 ff96e61 commit 3c9e0f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/k3_j72xx_bandgap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,10 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
521521
return ret;
522522
}
523523

524-
static int k3_j72xx_bandgap_remove(struct platform_device *pdev)
524+
static void k3_j72xx_bandgap_remove(struct platform_device *pdev)
525525
{
526526
pm_runtime_put_sync(&pdev->dev);
527527
pm_runtime_disable(&pdev->dev);
528-
529-
return 0;
530528
}
531529

532530
static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j721e_data = {
@@ -552,7 +550,7 @@ MODULE_DEVICE_TABLE(of, of_k3_j72xx_bandgap_match);
552550

553551
static struct platform_driver k3_j72xx_bandgap_sensor_driver = {
554552
.probe = k3_j72xx_bandgap_probe,
555-
.remove = k3_j72xx_bandgap_remove,
553+
.remove_new = k3_j72xx_bandgap_remove,
556554
.driver = {
557555
.name = "k3-j72xx-soc-thermal",
558556
.of_match_table = of_k3_j72xx_bandgap_match,

0 commit comments

Comments
 (0)