Skip to content

Commit cdf179a

Browse files
Uwe Kleine-KönigJassiBrar
authored andcommitted
mailbox: zynqmp-ipi: 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> Reviewed-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
1 parent ab572ab commit cdf179a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mailbox/zynqmp-ipi-mailbox.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,19 +687,17 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
687687
return ret;
688688
}
689689

690-
static int zynqmp_ipi_remove(struct platform_device *pdev)
690+
static void zynqmp_ipi_remove(struct platform_device *pdev)
691691
{
692692
struct zynqmp_ipi_pdata *pdata;
693693

694694
pdata = platform_get_drvdata(pdev);
695695
zynqmp_ipi_free_mboxes(pdata);
696-
697-
return 0;
698696
}
699697

700698
static struct platform_driver zynqmp_ipi_driver = {
701699
.probe = zynqmp_ipi_probe,
702-
.remove = zynqmp_ipi_remove,
700+
.remove_new = zynqmp_ipi_remove,
703701
.driver = {
704702
.name = "zynqmp-ipi",
705703
.of_match_table = of_match_ptr(zynqmp_ipi_of_match),

0 commit comments

Comments
 (0)