Skip to content

Commit d183b20

Browse files
Uwe Kleine-Könignmenon
authored andcommitted
soc/ti: pruss: 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> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-38-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 9eb950e commit d183b20

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/ti/pruss.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,16 +565,14 @@ static int pruss_probe(struct platform_device *pdev)
565565
return ret;
566566
}
567567

568-
static int pruss_remove(struct platform_device *pdev)
568+
static void pruss_remove(struct platform_device *pdev)
569569
{
570570
struct device *dev = &pdev->dev;
571571

572572
devm_of_platform_depopulate(dev);
573573

574574
pm_runtime_put_sync(dev);
575575
pm_runtime_disable(dev);
576-
577-
return 0;
578576
}
579577

580578
/* instance-specific driver private data */
@@ -610,7 +608,7 @@ static struct platform_driver pruss_driver = {
610608
.of_match_table = pruss_of_match,
611609
},
612610
.probe = pruss_probe,
613-
.remove = pruss_remove,
611+
.remove_new = pruss_remove,
614612
};
615613
module_platform_driver(pruss_driver);
616614

0 commit comments

Comments
 (0)