Skip to content

Commit 82e83cb

Browse files
Uwe Kleine-Könignmenon
authored andcommitted
soc/ti: wkup_m3_ipc: 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-40-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent ba03aab commit 82e83cb

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/ti/wkup_m3_ipc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
713713
return ret;
714714
}
715715

716-
static int wkup_m3_ipc_remove(struct platform_device *pdev)
716+
static void wkup_m3_ipc_remove(struct platform_device *pdev)
717717
{
718718
wkup_m3_ipc_dbg_destroy(m3_ipc_state);
719719

@@ -723,8 +723,6 @@ static int wkup_m3_ipc_remove(struct platform_device *pdev)
723723
rproc_put(m3_ipc_state->rproc);
724724

725725
m3_ipc_state = NULL;
726-
727-
return 0;
728726
}
729727

730728
static int __maybe_unused wkup_m3_ipc_suspend(struct device *dev)
@@ -760,7 +758,7 @@ MODULE_DEVICE_TABLE(of, wkup_m3_ipc_of_match);
760758

761759
static struct platform_driver wkup_m3_ipc_driver = {
762760
.probe = wkup_m3_ipc_probe,
763-
.remove = wkup_m3_ipc_remove,
761+
.remove_new = wkup_m3_ipc_remove,
764762
.driver = {
765763
.name = "wkup_m3_ipc",
766764
.of_match_table = wkup_m3_ipc_of_match,

0 commit comments

Comments
 (0)