Skip to content

Commit 6ac63d0

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
firmware: stratix10-rsu: 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: Dinh Nguyen <dinguyen@kernel.org> Link: https://lore.kernel.org/r/06df45c697a747cb6543800a4613db6e1f5462b4.1703693980.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ffc3c92 commit 6ac63d0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/firmware/stratix10-rsu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,17 +793,16 @@ static int stratix10_rsu_probe(struct platform_device *pdev)
793793
return ret;
794794
}
795795

796-
static int stratix10_rsu_remove(struct platform_device *pdev)
796+
static void stratix10_rsu_remove(struct platform_device *pdev)
797797
{
798798
struct stratix10_rsu_priv *priv = platform_get_drvdata(pdev);
799799

800800
stratix10_svc_free_channel(priv->chan);
801-
return 0;
802801
}
803802

804803
static struct platform_driver stratix10_rsu_driver = {
805804
.probe = stratix10_rsu_probe,
806-
.remove = stratix10_rsu_remove,
805+
.remove_new = stratix10_rsu_remove,
807806
.driver = {
808807
.name = "stratix10-rsu",
809808
.dev_groups = rsu_groups,

0 commit comments

Comments
 (0)