Skip to content

Commit d74a5c1

Browse files
Uwe Kleine-Königdavem330
authored andcommitted
net: ethernet: xscale: 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> Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2e0ec0a commit d74a5c1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/net/ethernet/xscale/ixp4xx_eth.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)
15331533
return err;
15341534
}
15351535

1536-
static int ixp4xx_eth_remove(struct platform_device *pdev)
1536+
static void ixp4xx_eth_remove(struct platform_device *pdev)
15371537
{
15381538
struct net_device *ndev = platform_get_drvdata(pdev);
15391539
struct phy_device *phydev = ndev->phydev;
@@ -1544,7 +1544,6 @@ static int ixp4xx_eth_remove(struct platform_device *pdev)
15441544
ixp4xx_mdio_remove();
15451545
npe_port_tab[NPE_ID(port->id)] = NULL;
15461546
npe_release(port->npe);
1547-
return 0;
15481547
}
15491548

15501549
static const struct of_device_id ixp4xx_eth_of_match[] = {
@@ -1560,7 +1559,7 @@ static struct platform_driver ixp4xx_eth_driver = {
15601559
.of_match_table = of_match_ptr(ixp4xx_eth_of_match),
15611560
},
15621561
.probe = ixp4xx_eth_probe,
1563-
.remove = ixp4xx_eth_remove,
1562+
.remove_new = ixp4xx_eth_remove,
15641563
};
15651564
module_platform_driver(ixp4xx_eth_driver);
15661565

0 commit comments

Comments
 (0)