Skip to content

Commit a2879f7

Browse files
Uwe Kleine-Königdavem330
authored andcommitted
net: mdio: mux-meson-gxl: 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() is 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: David S. Miller <davem@davemloft.net>
1 parent 458eb39 commit a2879f7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/mdio/mdio-mux-meson-gxl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,16 @@ static int gxl_mdio_mux_probe(struct platform_device *pdev)
140140
return ret;
141141
}
142142

143-
static int gxl_mdio_mux_remove(struct platform_device *pdev)
143+
static void gxl_mdio_mux_remove(struct platform_device *pdev)
144144
{
145145
struct gxl_mdio_mux *priv = platform_get_drvdata(pdev);
146146

147147
mdio_mux_uninit(priv->mux_handle);
148-
149-
return 0;
150148
}
151149

152150
static struct platform_driver gxl_mdio_mux_driver = {
153151
.probe = gxl_mdio_mux_probe,
154-
.remove = gxl_mdio_mux_remove,
152+
.remove_new = gxl_mdio_mux_remove,
155153
.driver = {
156154
.name = "gxl-mdio-mux",
157155
.of_match_table = gxl_mdio_mux_match,

0 commit comments

Comments
 (0)