Skip to content

Commit 9764bba

Browse files
Uwe Kleine-Königdavem330
authored andcommitted
net: dsa: mt7530: 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> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Acked-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a59f960 commit 9764bba

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/net/dsa/mt7530-mmio.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,12 @@ mt7988_probe(struct platform_device *pdev)
6363
return dsa_register_switch(priv->ds);
6464
}
6565

66-
static int
67-
mt7988_remove(struct platform_device *pdev)
66+
static void mt7988_remove(struct platform_device *pdev)
6867
{
6968
struct mt7530_priv *priv = platform_get_drvdata(pdev);
7069

7170
if (priv)
7271
mt7530_remove_common(priv);
73-
74-
return 0;
7572
}
7673

7774
static void mt7988_shutdown(struct platform_device *pdev)
@@ -88,7 +85,7 @@ static void mt7988_shutdown(struct platform_device *pdev)
8885

8986
static struct platform_driver mt7988_platform_driver = {
9087
.probe = mt7988_probe,
91-
.remove = mt7988_remove,
88+
.remove_new = mt7988_remove,
9289
.shutdown = mt7988_shutdown,
9390
.driver = {
9491
.name = "mt7530-mmio",

0 commit comments

Comments
 (0)