Skip to content

Commit 74701ff

Browse files
Uwe Kleine-KönigJassiBrar
authored andcommitted
mailbox: bcm-pdc: 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> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
1 parent d0a724d commit 74701ff

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mailbox/bcm-pdc-mailbox.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ static int pdc_probe(struct platform_device *pdev)
16051605
return err;
16061606
}
16071607

1608-
static int pdc_remove(struct platform_device *pdev)
1608+
static void pdc_remove(struct platform_device *pdev)
16091609
{
16101610
struct pdc_state *pdcs = platform_get_drvdata(pdev);
16111611

@@ -1617,12 +1617,11 @@ static int pdc_remove(struct platform_device *pdev)
16171617

16181618
dma_pool_destroy(pdcs->rx_buf_pool);
16191619
dma_pool_destroy(pdcs->ring_pool);
1620-
return 0;
16211620
}
16221621

16231622
static struct platform_driver pdc_mbox_driver = {
16241623
.probe = pdc_probe,
1625-
.remove = pdc_remove,
1624+
.remove_new = pdc_remove,
16261625
.driver = {
16271626
.name = "brcm-iproc-pdc-mbox",
16281627
.of_match_table = pdc_mbox_of_match,

0 commit comments

Comments
 (0)