Skip to content

Commit f34b902

Browse files
Uwe Kleine-Könignmenon
authored andcommitted
soc/ti: k3-ringacc: 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-34-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 7b7a224 commit f34b902

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/soc/ti/k3-ringacc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,19 +1551,18 @@ static int k3_ringacc_probe(struct platform_device *pdev)
15511551
return 0;
15521552
}
15531553

1554-
static int k3_ringacc_remove(struct platform_device *pdev)
1554+
static void k3_ringacc_remove(struct platform_device *pdev)
15551555
{
15561556
struct k3_ringacc *ringacc = dev_get_drvdata(&pdev->dev);
15571557

15581558
mutex_lock(&k3_ringacc_list_lock);
15591559
list_del(&ringacc->list);
15601560
mutex_unlock(&k3_ringacc_list_lock);
1561-
return 0;
15621561
}
15631562

15641563
static struct platform_driver k3_ringacc_driver = {
15651564
.probe = k3_ringacc_probe,
1566-
.remove = k3_ringacc_remove,
1565+
.remove_new = k3_ringacc_remove,
15671566
.driver = {
15681567
.name = "k3-ringacc",
15691568
.of_match_table = k3_ringacc_of_match,

0 commit comments

Comments
 (0)