Skip to content

Commit caa9b6b

Browse files
Uwe Kleine-Königdavem330
authored andcommitted
net: mdio: mux-multiplexer: 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 70edec6 commit caa9b6b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/mdio/mdio-mux-multiplexer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,14 @@ static int mdio_mux_multiplexer_probe(struct platform_device *pdev)
8585
return ret;
8686
}
8787

88-
static int mdio_mux_multiplexer_remove(struct platform_device *pdev)
88+
static void mdio_mux_multiplexer_remove(struct platform_device *pdev)
8989
{
9090
struct mdio_mux_multiplexer_state *s = platform_get_drvdata(pdev);
9191

9292
mdio_mux_uninit(s->mux_handle);
9393

9494
if (s->do_deselect)
9595
mux_control_deselect(s->muxc);
96-
97-
return 0;
9896
}
9997

10098
static const struct of_device_id mdio_mux_multiplexer_match[] = {
@@ -109,7 +107,7 @@ static struct platform_driver mdio_mux_multiplexer_driver = {
109107
.of_match_table = mdio_mux_multiplexer_match,
110108
},
111109
.probe = mdio_mux_multiplexer_probe,
112-
.remove = mdio_mux_multiplexer_remove,
110+
.remove_new = mdio_mux_multiplexer_remove,
113111
};
114112

115113
module_platform_driver(mdio_mux_multiplexer_driver);

0 commit comments

Comments
 (0)