Skip to content

Commit 955d668

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

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/mdio/mdio-moxart.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,12 @@ static int moxart_mdio_probe(struct platform_device *pdev)
155155
return ret;
156156
}
157157

158-
static int moxart_mdio_remove(struct platform_device *pdev)
158+
static void moxart_mdio_remove(struct platform_device *pdev)
159159
{
160160
struct mii_bus *bus = platform_get_drvdata(pdev);
161161

162162
mdiobus_unregister(bus);
163163
mdiobus_free(bus);
164-
165-
return 0;
166164
}
167165

168166
static const struct of_device_id moxart_mdio_dt_ids[] = {
@@ -173,7 +171,7 @@ MODULE_DEVICE_TABLE(of, moxart_mdio_dt_ids);
173171

174172
static struct platform_driver moxart_mdio_driver = {
175173
.probe = moxart_mdio_probe,
176-
.remove = moxart_mdio_remove,
174+
.remove_new = moxart_mdio_remove,
177175
.driver = {
178176
.name = "moxart-mdio",
179177
.of_match_table = moxart_mdio_dt_ids,

0 commit comments

Comments
 (0)