Message ID | 20230918204227.1316886-55-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | Accepted |
Commit | d74a5c154b6fab303023e46e7cc1b14c3f3cabd9 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: ethernet: Convert to platform remove callback returning void | expand |
Hello Uwe, Linus, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes: > 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. This makes perfect sense of course. BTW, Linus, this is a separate entry in MAINTAINERS (INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT). Perhaps you'd want it as well? While I still have access to IXP425 and IXP435 hw, I haven't (literally) touched them in years, so I guess there is very little reason (or rather none at all) for me to linger as a maintainer of anything related to IPX4xx anymore. If you wish, I can prepare a MAINTAINERS patch, or something. > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Krzysztof Hałasa <khalasa@piap.pl> > --- > drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-)
On Wed, Sep 20, 2023 at 9:52 AM Krzysztof Hałasa <khalasa@piap.pl> wrote: > BTW, Linus, this is a separate entry in MAINTAINERS (INTEL IXP4XX QMGR, > NPE, ETHERNET and HSS SUPPORT). Perhaps you'd want it as well? Indeed I guess I should move it all under the IXP4xx platform simply. Also Deepak is still listed as maintainer of the RNG which is inside the NPE, I think he has basically retired from maintenance as well because I think he mentioned that he got rid of his IXP4xx hardware. > While I still have access to IXP425 and IXP435 hw, Are they supported by the DTS files I created? > I haven't (literally) > touched them in years, so I guess there is very little reason (or rather > none at all) for me to linger as a maintainer of anything related to > IPX4xx anymore. If you wish, I can prepare a MAINTAINERS patch, or > something. Could you group the network and the RNG (which is just below it in MAINTAINERS) under the architecture (where you are BTW still listed). The devices mostly "just work" now though so if you touch them I bet they will come online nicely. This fork of OpenWrt has all that's needed to bring up devices: https://github.com/linusw/openwrt/commits/ixp4xx-v6.1 Yours, Linus Walleij
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 3b0c5f177447..b242aa61d8ab 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1533,7 +1533,7 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) return err; } -static int ixp4xx_eth_remove(struct platform_device *pdev) +static void ixp4xx_eth_remove(struct platform_device *pdev) { struct net_device *ndev = platform_get_drvdata(pdev); struct phy_device *phydev = ndev->phydev; @@ -1544,7 +1544,6 @@ static int ixp4xx_eth_remove(struct platform_device *pdev) ixp4xx_mdio_remove(); npe_port_tab[NPE_ID(port->id)] = NULL; npe_release(port->npe); - return 0; } static const struct of_device_id ixp4xx_eth_of_match[] = { @@ -1560,7 +1559,7 @@ static struct platform_driver ixp4xx_eth_driver = { .of_match_table = of_match_ptr(ixp4xx_eth_of_match), }, .probe = ixp4xx_eth_probe, - .remove = ixp4xx_eth_remove, + .remove_new = ixp4xx_eth_remove, }; module_platform_driver(ixp4xx_eth_driver);
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> --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)