Skip to content

Commit fa2bc3c

Browse files
Uwe Kleine-Königdavem330
authored andcommitted
net: mdio: mscc-miim: 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 955d668 commit fa2bc3c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/mdio/mdio-mscc-miim.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,13 @@ static int mscc_miim_probe(struct platform_device *pdev)
335335
return ret;
336336
}
337337

338-
static int mscc_miim_remove(struct platform_device *pdev)
338+
static void mscc_miim_remove(struct platform_device *pdev)
339339
{
340340
struct mii_bus *bus = platform_get_drvdata(pdev);
341341
struct mscc_miim_dev *miim = bus->priv;
342342

343343
clk_disable_unprepare(miim->clk);
344344
mdiobus_unregister(bus);
345-
346-
return 0;
347345
}
348346

349347
static const struct mscc_miim_info mscc_ocelot_miim_info = {
@@ -371,7 +369,7 @@ MODULE_DEVICE_TABLE(of, mscc_miim_match);
371369

372370
static struct platform_driver mscc_miim_driver = {
373371
.probe = mscc_miim_probe,
374-
.remove = mscc_miim_remove,
372+
.remove_new = mscc_miim_remove,
375373
.driver = {
376374
.name = "mscc-miim",
377375
.of_match_table = mscc_miim_match,

0 commit comments

Comments
 (0)