net: ethernet: Convert to platform remove callback returning void
Subsystems (52)
cover net: ethernet: Convert to platform remove callback returning void
Hello,
this series convert nearly all platform drivers below drivers/net/ethernet to use remove_new. The motivation is to get rid of an integer return code that is (mostly) ignored by the platform driver core and error prone on the driver side.
There are 3 drivers I didn't convert (yet):
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/cpsw_new.c
drivers/net/ethernet/ti/am65-cpsw-nuss.c
These are a bit more complicated because they don't always return 0 in .remove(). Unless someone is quicker than me, I'll address them in separate patches at a later time.
See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal.
There are no interdependencies between the patches. As there are still quite a few drivers to convert, I'm happy about every patch that makes it in. So even if there is a merge conflict with one patch until you apply, please apply the remainder of this series anyhow.
Best regards
Uwe
Uwe Kleine-König (54):
net: ethernet: 8390: Convert to platform remove callback returning
void
net: ethernet: actions: Convert to platform remove callback returning
void
net: ethernet: aeroflex: Convert to platform remove callback returning
void
net: ethernet: allwinner: Convert to platform remove callback
returning void
net: ethernet: altera: Convert to platform remove callback returning
void
net: ethernet: amd: Convert to platform remove callback returning void
net: ethernet: apm: Convert to platform remove callback returning void
net: ethernet: apple: Convert to platform remove callback returning
void
net: ethernet: arc: Convert to platform remove callback returning void
net: ethernet: atheros: Convert to platform remove callback returning
void
net: ethernet: broadcom: Convert to platform remove callback returning
void
net: ethernet: cadence: Convert to platform remove callback returning
void
net: ethernet: calxeda: Convert to platform remove callback returning
void
net: ethernet: cavium: Convert to platform remove callback returning
void
net: ethernet: cirrus: Convert to platform remove callback returning
void
net: ethernet: cortina: Convert to platform remove callback returning
void
net: ethernet: davicom: Convert to platform remove callback returning
void
net: ethernet: dnet: Convert to platform remove callback returning
void
net: ethernet: engleder: Convert to platform remove callback returning
void
net: ethernet: ethoc: Convert to platform remove callback returning
void
net: ethernet: faraday: Convert to platform remove callback returning
void
net: ethernet: hisilicon: Convert to platform remove callback
returning void
net: ethernet: i825xx: Convert to platform remove callback returning
void
net: ethernet: ibm: Convert to platform remove callback returning void
net: ethernet: korina: Convert to platform remove callback returning
void
net: ethernet: lantiq_etop: Convert to platform remove callback
returning void
net: ethernet: lantiq_xrx200: Convert to platform remove callback
returning void
net: ethernet: litex: Convert to platform remove callback returning
void
net: ethernet: marvell: Convert to platform remove callback returning
void
net: ethernet: mediatek: Convert to platform remove callback returning
void
net: ethernet: mellanox: Convert to platform remove callback returning
void
net: ethernet: micrel: Convert to platform remove callback returning
void
net: ethernet: microchip: Convert to platform remove callback
returning void
net: ethernet: moxa:: Convert to platform remove callback returning
void
net: ethernet: mscc: Convert to platform remove callback returning
void
net: ethernet: natsemi: Convert to platform remove callback returning
void
net: ethernet: natsemi: Convert to platform remove callback returning
void
net: ethernet: ni: Convert to platform remove callback returning void
net: ethernet: nxp: Convert to platform remove callback returning void
net: ethernet: qualcomm: Convert to platform remove callback returning
void
net: ethernet: renesas: Convert to platform remove callback returning
void
net: ethernet: samsung: Convert to platform remove callback returning
void
net: ethernet: seeq: Convert to platform remove callback returning
void
net: ethernet: sgi: Convert to platform remove callback returning void
net: ethernet: smsc: Convert to platform remove callback returning
void
net: ethernet: socionext: Convert to platform remove callback
returning void
net: ethernet: sun: Convert to platform remove callback returning void
net: ethernet: sunplus: Convert to platform remove callback returning
void
net: ethernet: ti: Convert to platform remove callback returning void
net: ethernet: tundra: Convert to platform remove callback returning
void
net: ethernet: via: Convert to platform remove callback returning void
net: ethernet: wiznet: Convert to platform remove callback returning
void
net: ethernet: xilinx: Convert to platform remove callback returning
void
net: ethernet: xscale: Convert to platform remove callback returning
void
drivers/net/ethernet/8390/ax88796.c | 6 ++---- drivers/net/ethernet/8390/mcf8390.c | 5 ++--- drivers/net/ethernet/8390/ne.c | 5 ++--- drivers/net/ethernet/actions/owl-emac.c | 6 ++---- drivers/net/ethernet/aeroflex/greth.c | 6 ++---- drivers/net/ethernet/allwinner/sun4i-emac.c | 5 ++--- drivers/net/ethernet/altera/altera_tse_main.c | 6 ++---- drivers/net/ethernet/amd/au1000_eth.c | 6 ++---- drivers/net/ethernet/amd/sunlance.c | 6 ++---- drivers/net/ethernet/amd/xgbe/xgbe-platform.c | 6 ++---- drivers/net/ethernet/apm/xgene-v2/main.c | 6 ++---- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 6 ++---- drivers/net/ethernet/apple/macmace.c | 6 ++---- drivers/net/ethernet/arc/emac_arc.c | 6 ++---- drivers/net/ethernet/arc/emac_rockchip.c | 5 ++--- drivers/net/ethernet/atheros/ag71xx.c | 8 +++----- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 8 +++----- drivers/net/ethernet/broadcom/bcm4908_enet.c | 6 ++---- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 10 ++++------ drivers/net/ethernet/broadcom/bcmsysport.c | 6 ++---- drivers/net/ethernet/broadcom/bgmac-platform.c | 6 ++---- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++---- drivers/net/ethernet/broadcom/sb1250-mac.c | 6 ++---- drivers/net/ethernet/cadence/macb_main.c | 6 ++---- drivers/net/ethernet/calxeda/xgmac.c | 6 ++---- drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 5 ++--- drivers/net/ethernet/cirrus/cs89x0.c | 5 ++--- drivers/net/ethernet/cirrus/ep93xx_eth.c | 8 +++----- drivers/net/ethernet/cirrus/mac89x0.c | 5 ++--- drivers/net/ethernet/cortina/gemini.c | 12 ++++-------- drivers/net/ethernet/davicom/dm9000.c | 6 ++---- drivers/net/ethernet/dnet.c | 6 ++---- drivers/net/ethernet/engleder/tsnep_main.c | 6 ++---- drivers/net/ethernet/ethoc.c | 6 ++---- drivers/net/ethernet/faraday/ftgmac100.c | 5 ++--- drivers/net/ethernet/faraday/ftmac100.c | 5 ++--- drivers/net/ethernet/hisilicon/hip04_eth.c | 6 ++---- drivers/net/ethernet/hisilicon/hisi_femac.c | 6 ++---- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 6 ++---- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 6 ++---- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 5 ++--- drivers/net/ethernet/hisilicon/hns_mdio.c | 5 ++--- drivers/net/ethernet/i825xx/sni_82596.c | 5 ++--- drivers/net/ethernet/ibm/ehea/ehea_main.c | 8 +++----- drivers/net/ethernet/ibm/emac/core.c | 6 ++---- drivers/net/ethernet/ibm/emac/mal.c | 6 ++---- drivers/net/ethernet/ibm/emac/rgmii.c | 6 ++---- drivers/net/ethernet/ibm/emac/tah.c | 6 ++---- drivers/net/ethernet/ibm/emac/zmii.c | 6 ++---- drivers/net/ethernet/korina.c | 6 ++---- drivers/net/ethernet/lantiq_etop.c | 6 ++---- drivers/net/ethernet/lantiq_xrx200.c | 6 ++---- drivers/net/ethernet/litex/litex_liteeth.c | 6 ++---- drivers/net/ethernet/marvell/mv643xx_eth.c | 11 ++++------- drivers/net/ethernet/marvell/mvmdio.c | 6 ++---- drivers/net/ethernet/marvell/mvneta.c | 6 ++---- drivers/net/ethernet/marvell/mvneta_bm.c | 6 ++---- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 8 +++----- drivers/net/ethernet/marvell/pxa168_eth.c | 5 ++--- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++---- .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 6 ++---- drivers/net/ethernet/micrel/ks8842.c | 5 ++--- drivers/net/ethernet/micrel/ks8851_par.c | 6 ++---- .../net/ethernet/microchip/lan966x/lan966x_main.c | 6 ++---- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 6 ++---- drivers/net/ethernet/moxa/moxart_ether.c | 6 ++---- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 6 ++---- drivers/net/ethernet/natsemi/jazzsonic.c | 6 ++---- drivers/net/ethernet/natsemi/macsonic.c | 6 ++---- drivers/net/ethernet/natsemi/xtsonic.c | 6 ++---- drivers/net/ethernet/ni/nixge.c | 6 ++---- drivers/net/ethernet/nxp/lpc_eth.c | 6 ++---- drivers/net/ethernet/qualcomm/emac/emac.c | 6 ++---- drivers/net/ethernet/renesas/ravb_main.c | 6 ++---- drivers/net/ethernet/renesas/rswitch.c | 6 ++---- drivers/net/ethernet/renesas/sh_eth.c | 6 ++---- drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 6 ++---- drivers/net/ethernet/seeq/sgiseeq.c | 6 ++---- drivers/net/ethernet/sgi/ioc3-eth.c | 6 ++---- drivers/net/ethernet/sgi/meth.c | 6 ++---- drivers/net/ethernet/smsc/smc91x.c | 6 ++---- drivers/net/ethernet/smsc/smsc911x.c | 6 ++---- drivers/net/ethernet/socionext/netsec.c | 6 ++---- drivers/net/ethernet/socionext/sni_ave.c | 6 ++---- drivers/net/ethernet/sun/niu.c | 5 ++--- drivers/net/ethernet/sun/sunbmac.c | 6 ++---- drivers/net/ethernet/sun/sunqe.c | 6 ++---- drivers/net/ethernet/sunplus/spl2sw_driver.c | 6 ++---- drivers/net/ethernet/ti/cpmac.c | 6 ++---- drivers/net/ethernet/ti/davinci_emac.c | 6 ++---- drivers/net/ethernet/ti/davinci_mdio.c | 6 ++---- drivers/net/ethernet/ti/netcp_core.c | 5 ++--- drivers/net/ethernet/tundra/tsi108_eth.c | 6 ++---- drivers/net/ethernet/via/via-rhine.c | 6 ++---- drivers/net/ethernet/via/via-velocity.c | 6 ++---- drivers/net/ethernet/wiznet/w5100.c | 6 ++---- drivers/net/ethernet/wiznet/w5300.c | 5 ++--- drivers/net/ethernet/xilinx/ll_temac_main.c | 5 ++--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 ++---- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++---- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++--- 101 files changed, 213 insertions(+), 399 deletions(-)
base-commit: 7fc7222d9680366edeecc219c21ca96310bdbc10
Signature · 1 line
2.40.1
PATCH 1/54 net: ethernet: 8390: 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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/8390/ax88796.c | 6 ++---- drivers/net/ethernet/8390/mcf8390.c | 5 ++--- drivers/net/ethernet/8390/ne.c | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-)
drivers/net/ethernet/8390/ax88796.c +2 -4
@@ -811,7 +811,7 @@ static int ax_init_dev(struct net_device *dev)return ret; } -static int ax_remove (struct platform_device *pdev) +static void ax_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct ei_device *ei_local =netdev_priv (dev);
@@ -832,8 +832,6 @@ static int ax_remove(struct platform_device *pdev)platform_set_drvdata (pdev,NULL );free_netdev (dev); - -return 0 ; }/*
@@ -1011,7 +1009,7 @@ static struct platform_driver axdrv = { .name = "ax88796", }, .probe = ax_probe, - .remove = ax_remove, + .remove_new = ax_remove, .suspend = ax_suspend, .resume = ax_resume, };
drivers/net/ethernet/8390/mcf8390.c +2 -3
@@ -441,7 +441,7 @@ static int mcf8390_probe(struct platform_device *pdev)return 0 ; } -static int mcf8390_remove (struct platform_device *pdev) +static void mcf8390_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct resource *mem;
@@ -450,7 +450,6 @@ static int mcf8390_remove(struct platform_device *pdev) mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 );release_mem_region (mem->start,resource_size (mem));free_netdev (dev); -return 0 ; }static struct platform_driver mcf8390_drv = {
@@ -458,7 +457,7 @@ static struct platform_driver mcf8390_drv = { .name = "mcf8390", }, .probe = mcf8390_probe, - .remove = mcf8390_remove, + .remove_new = mcf8390_remove, };module_platform_driver (mcf8390_drv);
drivers/net/ethernet/8390/ne.c +2 -3
@@ -823,7 +823,7 @@ static int __init ne_drv_probe(struct platform_device *pdev)return 0 ; } -static int ne_drv_remove (struct platform_device *pdev) +static void ne_drv_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);
@@ -842,7 +842,6 @@ static int ne_drv_remove(struct platform_device *pdev)release_region (dev->base_addr,NE_IO_EXTENT );free_netdev (dev); } -return 0 ; }/* Remove unused devices or all if true. */
@@ -895,7 +894,7 @@ static int ne_drv_resume(struct platform_device *pdev)#endif static struct platform_driver ne_driver = { - .remove = ne_drv_remove, + .remove_new = ne_drv_remove, .suspend = ne_drv_suspend, .resume = ne_drv_resume, .driver = {
Signature · 1 line
2.40.1
PATCH 2/54 net: ethernet: actions: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/actions/owl-emac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/actions/owl-emac.c +2 -4
@@ -1582,15 +1582,13 @@ static int owl_emac_probe(struct platform_device *pdev)return 0 ; } -static int owl_emac_remove (struct platform_device *pdev) +static void owl_emac_remove (struct platform_device *pdev) {struct owl_emac_priv *priv =platform_get_drvdata (pdev);netif_napi_del (&priv->napi);phy_disconnect (priv->netdev->phydev);cancel_work_sync (&priv->mac_reset_task); - -return 0 ; }static const struct of_device_id owl_emac_of_match[] = {
@@ -1609,7 +1607,7 @@ static struct platform_driver owl_emac_driver = { .pm = &owl_emac_pm_ops, }, .probe = owl_emac_probe, - .remove = owl_emac_remove, + .remove_new = owl_emac_remove, };module_platform_driver (owl_emac_driver);
Signature · 1 line
2.40.1
PATCH 3/54 net: ethernet: aeroflex: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/aeroflex/greth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/aeroflex/greth.c +2 -4
@@ -1525,7 +1525,7 @@ static int greth_of_probe(struct platform_device *ofdev)return err; } -static int greth_of_remove (struct platform_device *of_dev) +static void greth_of_remove (struct platform_device *of_dev) {struct net_device *ndev =platform_get_drvdata (of_dev);struct greth_private *greth =netdev_priv (ndev);
@@ -1544,8 +1544,6 @@ static int greth_of_remove(struct platform_device *of_dev)of_iounmap (&of_dev->resource[0 ], greth->regs,resource_size (&of_dev->resource[0 ]));free_netdev (ndev); - -return 0 ; }static const struct of_device_id greth_of_match[] = {
@@ -1566,7 +1564,7 @@ static struct platform_driver greth_of_driver = { .of_match_table = greth_of_match, }, .probe = greth_of_probe, - .remove = greth_of_remove, + .remove_new = greth_of_remove, };module_platform_driver (greth_of_driver);
Signature · 1 line
2.40.1
PATCH 4/54 net: ethernet: allwinner: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +2 -3
@@ -1083,7 +1083,7 @@ static int emac_probe(struct platform_device *pdev)return ret; } -static int emac_remove (struct platform_device *pdev) +static void emac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct emac_board_info *db =netdev_priv (ndev);
@@ -1101,7 +1101,6 @@ static int emac_remove(struct platform_device *pdev)free_netdev (ndev);dev_dbg (&pdev->dev,"released and freed device\n" ); -return 0 ; }static int emac_suspend (struct platform_device *dev,pm_message_t state)
@@ -1143,7 +1142,7 @@ static struct platform_driver emac_driver = { .of_match_table = emac_of_match, }, .probe = emac_probe, - .remove = emac_remove, + .remove_new = emac_remove, .suspend = emac_suspend, .resume = emac_resume, };
Signature · 1 line
2.40.1
Re: [PATCH net-next 04/54] net: ethernet: allwinner: Convert to platform remove callback returning void
Dne ponedeljek, 18. september 2023 ob 22:41:36 CEST je Uwe Kleine-König napisal(a):
Quoted 9 lines
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().
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Best regards,
Jernej
Quoted 35 lines
--- drivers/net/ethernet/allwinner/sun4i-emac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/net/ethernet/allwinner/sun4i-emac.cindexa94c62956eed..d761c08fe5c1100644drivers/net/ethernet/allwinner/sun4i-emac.c +2
-3@@ -1083,7 +1083,7 @@ static int emac_probe(struct platform_device *pdev)return ret; } -static int emac_remove (struct platform_device *pdev) +static void emac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct emac_board_info *db =netdev_priv (ndev);@@ -1101,7 +1101,6 @@ static int emac_remove(struct platform_device *pdev)free_netdev (ndev);dev_dbg (&pdev->dev,"released and freed device\n" ); -return 0 ; }static int emac_suspend (struct platform_device *dev,pm_message_t state)@@ -1143,7 +1142,7 @@ static struct platform_driver emac_driver = { .of_match_table = emac_of_match, }, .probe = emac_probe, - .remove = emac_remove, + .remove_new = emac_remove, .suspend = emac_suspend, .resume = emac_resume, };
PATCH 5/54 net: ethernet: altera: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/altera/altera_tse_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/altera/altera_tse_main.c +2 -4
@@ -1464,7 +1464,7 @@ static int altera_tse_probe(struct platform_device *pdev)/* Remove Altera TSE MAC device */ -static int altera_tse_remove (struct platform_device *pdev) +static void altera_tse_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct altera_tse_private *priv =netdev_priv (ndev);
@@ -1476,8 +1476,6 @@ static int altera_tse_remove(struct platform_device *pdev)lynx_pcs_destroy (priv->pcs);free_netdev (ndev); - -return 0 ; }static const struct altera_dmaops altera_dtype_sgdma = {
@@ -1528,7 +1526,7 @@ MODULE_DEVICE_TABLE(of, altera_tse_ids);static struct platform_driver altera_tse_driver = { .probe = altera_tse_probe, - .remove = altera_tse_remove, + .remove_new = altera_tse_remove, .suspend =NULL , .resume =NULL , .driver = {
Signature · 1 line
2.40.1
PATCH 6/54 net: ethernet: amd: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/amd/au1000_eth.c | 6 ++---- drivers/net/ethernet/amd/sunlance.c | 6 ++---- drivers/net/ethernet/amd/xgbe/xgbe-platform.c | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-)
drivers/net/ethernet/amd/au1000_eth.c +2 -4
@@ -1323,7 +1323,7 @@ static int au1000_probe(struct platform_device *pdev)return err; } -static int au1000_remove (struct platform_device *pdev) +static void au1000_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct au1000_private *aup =netdev_priv (dev);
@@ -1359,13 +1359,11 @@ static int au1000_remove(struct platform_device *pdev)release_mem_region (macen->start,resource_size (macen));free_netdev (dev); - -return 0 ; }static struct platform_driver au1000_eth_driver = { .probe = au1000_probe, - .remove = au1000_remove, + .remove_new = au1000_remove, .driver = { .name ="au1000-eth" , },
drivers/net/ethernet/amd/sunlance.c +2 -4
@@ -1487,7 +1487,7 @@ static int sunlance_sbus_probe(struct platform_device *op)return err; } -static int sunlance_sbus_remove (struct platform_device *op) +static void sunlance_sbus_remove (struct platform_device *op) {struct lance_private *lp =platform_get_drvdata (op);struct net_device *net_dev = lp->dev;
@@ -1497,8 +1497,6 @@ static int sunlance_sbus_remove(struct platform_device *op)lance_free_hwresources (lp);free_netdev (net_dev); - -return 0 ; }static const struct of_device_id sunlance_sbus_match[] = {
@@ -1516,7 +1514,7 @@ static struct platform_driver sunlance_sbus_driver = { .of_match_table = sunlance_sbus_match, }, .probe = sunlance_sbus_probe, - .remove = sunlance_sbus_remove, + .remove_new = sunlance_sbus_remove, };module_platform_driver (sunlance_sbus_driver);
drivers/net/ethernet/amd/xgbe/xgbe-platform.c +2 -4
@@ -512,7 +512,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)return ret; } -static int xgbe_platform_remove (struct platform_device *pdev) +static void xgbe_platform_remove (struct platform_device *pdev) {struct xgbe_prv_data *pdata =platform_get_drvdata (pdev);
@@ -521,8 +521,6 @@ static int xgbe_platform_remove(struct platform_device *pdev)platform_device_put (pdata->phy_platdev);xgbe_free_pdata (pdata); - -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -615,7 +613,7 @@ static struct platform_driver xgbe_driver = { .pm = &xgbe_platform_pm_ops, }, .probe = xgbe_platform_probe, - .remove = xgbe_platform_remove, + .remove_new = xgbe_platform_remove, };int xgbe_platform_init (void )
Signature · 1 line
2.40.1
PATCH 7/54 net: ethernet: apm: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these driver from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/apm/xgene-v2/main.c | 6 ++---- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/apm/xgene-v2/main.c +2 -4
@@ -690,7 +690,7 @@ static int xge_probe(struct platform_device *pdev)return ret; } -static int xge_remove (struct platform_device *pdev) +static void xge_remove (struct platform_device *pdev) {struct xge_pdata *pdata;struct net_device *ndev;
@@ -706,8 +706,6 @@ static int xge_remove(struct platform_device *pdev)xge_mdio_remove (ndev);unregister_netdev (ndev);free_netdev (ndev); - -return 0 ; }static void xge_shutdown (struct platform_device *pdev)
@@ -736,7 +734,7 @@ static struct platform_driver xge_driver = { .acpi_match_table = ACPI_PTR(xge_acpi_match), }, .probe = xge_probe, - .remove = xge_remove, + .remove_new = xge_remove, .shutdown = xge_shutdown, };module_platform_driver (xge_driver);
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +2 -4
@@ -2127,7 +2127,7 @@ static int xgene_enet_probe(struct platform_device *pdev)return ret; } -static int xgene_enet_remove (struct platform_device *pdev) +static void xgene_enet_remove (struct platform_device *pdev) {struct xgene_enet_pdata *pdata;struct net_device *ndev;
@@ -2149,8 +2149,6 @@ static int xgene_enet_remove(struct platform_device *pdev)xgene_enet_delete_desc_rings (pdata); pdata->port_ops->shutdown (pdata);free_netdev (ndev); - -return 0 ; }static void xgene_enet_shutdown (struct platform_device *pdev)
@@ -2174,7 +2172,7 @@ static struct platform_driver xgene_enet_driver = { .acpi_match_table = ACPI_PTR(xgene_enet_acpi_match), }, .probe = xgene_enet_probe, - .remove = xgene_enet_remove, + .remove_new = xgene_enet_remove, .shutdown = xgene_enet_shutdown, };
Signature · 1 line
2.40.1
PATCH 8/54 net: ethernet: apple: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/apple/macmace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/apple/macmace.c +2 -4
@@ -739,7 +739,7 @@ MODULE_LICENSE("GPL");MODULE_DESCRIPTION ("Macintosh MACE ethernet driver" );MODULE_ALIAS ("platform:macmace" ); -static int mac_mace_device_remove (struct platform_device *pdev) +static void mac_mace_device_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct mace_data *mp =netdev_priv (dev);
@@ -755,13 +755,11 @@ static int mac_mace_device_remove(struct platform_device *pdev) mp->tx_ring, mp->tx_ring_phys);free_netdev (dev); - -return 0 ; }static struct platform_driver mac_mace_driver = { .probe = mace_probe, - .remove = mac_mace_device_remove, + .remove_new = mac_mace_device_remove, .driver = { .name = mac_mace_string, },
Signature · 1 line
2.40.1
PATCH 9/54 net: ethernet: arc: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/arc/emac_arc.c | 6 ++---- drivers/net/ethernet/arc/emac_rockchip.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/net/ethernet/arc/emac_arc.c +2 -4
@@ -58,14 +58,12 @@ static int emac_arc_probe(struct platform_device *pdev)return err; } -static int emac_arc_remove (struct platform_device *pdev) +static void emac_arc_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);arc_emac_remove (ndev);free_netdev (ndev); - -return 0 ; }static const struct of_device_id emac_arc_dt_ids[] = {
@@ -76,7 +74,7 @@ MODULE_DEVICE_TABLE(of, emac_arc_dt_ids);static struct platform_driver emac_arc_driver = { .probe = emac_arc_probe, - .remove = emac_arc_remove, + .remove_new = emac_arc_remove, .driver = { .name =DRV_NAME , .of_match_table = emac_arc_dt_ids,
drivers/net/ethernet/arc/emac_rockchip.c +2 -3
@@ -244,7 +244,7 @@ static int emac_rockchip_probe(struct platform_device *pdev)return err; } -static int emac_rockchip_remove (struct platform_device *pdev) +static void emac_rockchip_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct rockchip_priv_data *priv =netdev_priv (ndev);
@@ -260,12 +260,11 @@ static int emac_rockchip_remove(struct platform_device *pdev)clk_disable_unprepare (priv->macclk);free_netdev (ndev); -return 0 ; }static struct platform_driver emac_rockchip_driver = { .probe = emac_rockchip_probe, - .remove = emac_rockchip_remove, + .remove_new = emac_rockchip_remove, .driver = { .name =DRV_NAME , .of_match_table = emac_rockchip_dt_ids,
Signature · 1 line
2.40.1
PATCH 10/54 net: ethernet: atheros: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/atheros/ag71xx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ethernet/atheros/ag71xx.c +3 -5
@@ -1968,21 +1968,19 @@ static int ag71xx_probe(struct platform_device *pdev)return err; } -static int ag71xx_remove (struct platform_device *pdev) +static void ag71xx_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct ag71xx *ag;if (!ndev) -return 0 ; +return ; ag =netdev_priv (ndev);unregister_netdev (ndev);ag71xx_mdio_remove (ag);clk_disable_unprepare (ag->clk_eth);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static const u32 ar71xx_fifo_ar7100[] = {
@@ -2069,7 +2067,7 @@ static const struct of_device_id ag71xx_match[] = {static struct platform_driver ag71xx_driver = { .probe = ag71xx_probe, - .remove = ag71xx_remove, + .remove_new = ag71xx_remove, .driver = { .name ="ag71xx" , .of_match_table = ag71xx_match,
Signature · 1 line
2.40.1
PATCH 11/54 net: ethernet: broadcom: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 8 +++----- drivers/net/ethernet/broadcom/bcm4908_enet.c | 6 ++---- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 10 ++++------ drivers/net/ethernet/broadcom/bcmsysport.c | 6 ++---- drivers/net/ethernet/broadcom/bgmac-platform.c | 6 ++---- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++---- drivers/net/ethernet/broadcom/sb1250-mac.c | 6 ++---- 7 files changed, 17 insertions(+), 31 deletions(-)
drivers/net/ethernet/broadcom/asp2/bcmasp.c +3 -5
@@ -1344,17 +1344,15 @@ static int bcmasp_probe(struct platform_device *pdev)return ret; } -static int bcmasp_remove (struct platform_device *pdev) +static void bcmasp_remove (struct platform_device *pdev) {struct bcmasp_priv *priv =dev_get_drvdata (&pdev->dev);if (!priv) -return 0 ; +return ; priv->destroy_wol (priv);bcmasp_remove_intfs (priv); - -return 0 ; }static void bcmasp_shutdown (struct platform_device *pdev)
@@ -1428,7 +1426,7 @@ static SIMPLE_DEV_PM_OPS(bcmasp_pm_ops,static struct platform_driver bcmasp_driver = { .probe = bcmasp_probe, - .remove = bcmasp_remove, + .remove_new = bcmasp_remove, .shutdown = bcmasp_shutdown, .driver = { .name ="brcm,asp-v2" ,
drivers/net/ethernet/broadcom/bcm4908_enet.c +2 -4
@@ -768,7 +768,7 @@ static int bcm4908_enet_probe(struct platform_device *pdev)return err; } -static int bcm4908_enet_remove (struct platform_device *pdev) +static void bcm4908_enet_remove (struct platform_device *pdev) {struct bcm4908_enet *enet =platform_get_drvdata (pdev);
@@ -776,8 +776,6 @@ static int bcm4908_enet_remove(struct platform_device *pdev)netif_napi_del (&enet->rx_ring.napi);netif_napi_del (&enet->tx_ring.napi);bcm4908_enet_dma_free (enet); - -return 0 ; }static const struct of_device_id bcm4908_enet_of_match[] = {
@@ -791,7 +789,7 @@ static struct platform_driver bcm4908_enet_driver = { .of_match_table = bcm4908_enet_of_match, }, .probe = bcm4908_enet_probe, - .remove = bcm4908_enet_remove, + .remove_new = bcm4908_enet_remove, };module_platform_driver (bcm4908_enet_driver);
drivers/net/ethernet/broadcom/bcm63xx_enet.c +4 -6
@@ -1902,7 +1902,7 @@ static int bcm_enet_probe(struct platform_device *pdev)/* * exit func, stops hardware and unregisters netdevice */ -static int bcm_enet_remove (struct platform_device *pdev) +static void bcm_enet_remove (struct platform_device *pdev) {struct bcm_enet_priv *priv;struct net_device *dev;
@@ -1932,12 +1932,11 @@ static int bcm_enet_remove(struct platform_device *pdev)clk_disable_unprepare (priv->mac_clk);free_netdev (dev); -return 0 ; }static struct platform_driver bcm63xx_enet_driver = { .probe = bcm_enet_probe, - .remove = bcm_enet_remove, + .remove_new = bcm_enet_remove, .driver = { .name ="bcm63xx_enet" , },
@@ -2739,7 +2738,7 @@ static int bcm_enetsw_probe(struct platform_device *pdev)/* exit func, stops hardware and unregisters netdevice */ -static int bcm_enetsw_remove (struct platform_device *pdev) +static void bcm_enetsw_remove (struct platform_device *pdev) {struct bcm_enet_priv *priv;struct net_device *dev;
@@ -2752,12 +2751,11 @@ static int bcm_enetsw_remove(struct platform_device *pdev)clk_disable_unprepare (priv->mac_clk);free_netdev (dev); -return 0 ; }static struct platform_driver bcm63xx_enetsw_driver = { .probe = bcm_enetsw_probe, - .remove = bcm_enetsw_remove, + .remove_new = bcm_enetsw_remove, .driver = { .name ="bcm63xx_enetsw" , },
drivers/net/ethernet/broadcom/bcmsysport.c +2 -4
@@ -2648,7 +2648,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)return ret; } -static int bcm_sysport_remove (struct platform_device *pdev) +static void bcm_sysport_remove (struct platform_device *pdev) {struct net_device *dev =dev_get_drvdata (&pdev->dev);struct bcm_sysport_priv *priv =netdev_priv (dev);
@@ -2663,8 +2663,6 @@ static int bcm_sysport_remove(struct platform_device *pdev)of_phy_deregister_fixed_link (dn);free_netdev (dev);dev_set_drvdata (&pdev->dev,NULL ); - -return 0 ; }static int bcm_sysport_suspend_to_wol (struct bcm_sysport_priv *priv)
@@ -2901,7 +2899,7 @@ static SIMPLE_DEV_PM_OPS(bcm_sysport_pm_ops,static struct platform_driver bcm_sysport_driver = { .probe = bcm_sysport_probe, - .remove = bcm_sysport_remove, + .remove_new = bcm_sysport_remove, .driver = { .name ="brcm-systemport" , .of_match_table = bcm_sysport_of_match,
drivers/net/ethernet/broadcom/bgmac-platform.c +2 -4
@@ -246,13 +246,11 @@ static int bgmac_probe(struct platform_device *pdev)return bgmac_enet_probe (bgmac); } -static int bgmac_remove (struct platform_device *pdev) +static void bgmac_remove (struct platform_device *pdev) {struct bgmac *bgmac =platform_get_drvdata (pdev);bgmac_enet_remove (bgmac); - -return 0 ; }#ifdef CONFIG_PM
@@ -296,7 +294,7 @@ static struct platform_driver bgmac_enet_driver = { .pm = BGMAC_PM_OPS }, .probe = bgmac_probe, - .remove = bgmac_remove, + .remove_new = bgmac_remove, };module_platform_driver (bgmac_enet_driver);
drivers/net/ethernet/broadcom/genet/bcmgenet.c +2 -4
@@ -4164,7 +4164,7 @@ static int bcmgenet_probe(struct platform_device *pdev)return err; } -static int bcmgenet_remove (struct platform_device *pdev) +static void bcmgenet_remove (struct platform_device *pdev) {struct bcmgenet_priv *priv =dev_to_priv (&pdev->dev);
@@ -4172,8 +4172,6 @@ static int bcmgenet_remove(struct platform_device *pdev)unregister_netdev (priv->dev);bcmgenet_mii_exit (priv->dev);free_netdev (priv->dev); - -return 0 ; }static void bcmgenet_shutdown (struct platform_device *pdev)
@@ -4352,7 +4350,7 @@ MODULE_DEVICE_TABLE(acpi, genet_acpi_match);static struct platform_driver bcmgenet_driver = { .probe = bcmgenet_probe, - .remove = bcmgenet_remove, + .remove_new = bcmgenet_remove, .shutdown = bcmgenet_shutdown, .driver = { .name ="bcmgenet" ,
drivers/net/ethernet/broadcom/sb1250-mac.c +2 -4
@@ -2593,7 +2593,7 @@ static int sbmac_probe(struct platform_device *pldev)return err; } -static int sbmac_remove (struct platform_device *pldev) +static void sbmac_remove (struct platform_device *pldev) {struct net_device *dev =platform_get_drvdata (pldev);struct sbmac_softc *sc =netdev_priv (dev);
@@ -2604,13 +2604,11 @@ static int sbmac_remove(struct platform_device *pldev)mdiobus_free (sc->mii_bus);iounmap (sc->sbm_base);free_netdev (dev); - -return 0 ; }static struct platform_driver sbmac_driver = { .probe = sbmac_probe, - .remove = sbmac_remove, + .remove_new = sbmac_remove, .driver = { .name = sbmac_string, },
Signature · 1 line
2.40.1
Re: [PATCH net-next 11/54] net: ethernet: broadcom: Convert to platform remove callback returning void
Quoted 9 lines · Uwe Kleine-König
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().
Quoted 4 lines
Trivially convert these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Signature · 1 line
Florian
PATCH 12/54 net: ethernet: cadence: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/cadence/macb_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +2 -4
@@ -5156,7 +5156,7 @@ static int macb_probe(struct platform_device *pdev)return err; } -static int macb_remove (struct platform_device *pdev) +static void macb_remove (struct platform_device *pdev) {struct net_device *dev;struct macb *bp;
@@ -5181,8 +5181,6 @@ static int macb_remove(struct platform_device *pdev)phylink_destroy (bp->phylink);free_netdev (dev); } - -return 0 ; }static int __maybe_unused macb_suspend (struct device *dev)
@@ -5398,7 +5396,7 @@ static const struct dev_pm_ops macb_pm_ops = {static struct platform_driver macb_driver = { .probe = macb_probe, - .remove = macb_remove, + .remove_new = macb_remove, .driver = { .name ="macb" , .of_match_table =of_match_ptr (macb_dt_ids),
Signature · 1 line
2.40.1
Re: [PATCH net-next 12/54] net: ethernet: cadence: Convert to platform remove callback returning void
Quoted 9 lines · Uwe Kleine-König
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().
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Quoted 35 lines
--- drivers/net/ethernet/cadence/macb_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/ethernet/cadence/macb_main.c +2
-4@@ -5156,7 +5156,7 @@ static int macb_probe(struct platform_device *pdev)return err; } -static int macb_remove (struct platform_device *pdev) +static void macb_remove (struct platform_device *pdev) {struct net_device *dev;struct macb *bp;@@ -5181,8 +5181,6 @@ static int macb_remove(struct platform_device *pdev)phylink_destroy (bp->phylink);free_netdev (dev); } - -return 0 ; }static int __maybe_unused macb_suspend (struct device *dev)@@ -5398,7 +5396,7 @@ static const struct dev_pm_ops macb_pm_ops = {static struct platform_driver macb_driver = { .probe = macb_probe, - .remove = macb_remove, + .remove_new = macb_remove, .driver = { .name ="macb" , .of_match_table =of_match_ptr (macb_dt_ids),
PATCH 13/54 net: ethernet: calxeda: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/calxeda/xgmac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/calxeda/xgmac.c +2 -4
@@ -1820,7 +1820,7 @@ static int xgmac_probe(struct platform_device *pdev)* changes the link status, releases the DMA descriptor rings, * unregisters the MDIO bus and unmaps the allocated memory. */ -static int xgmac_remove (struct platform_device *pdev) +static void xgmac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct xgmac_priv *priv =netdev_priv (ndev);
@@ -1840,8 +1840,6 @@ static int xgmac_remove(struct platform_device *pdev)release_mem_region (res->start,resource_size (res));free_netdev (ndev); - -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -1921,7 +1919,7 @@ static struct platform_driver xgmac_driver = { .pm = &xgmac_pm_ops, }, .probe = xgmac_probe, - .remove = xgmac_remove, + .remove_new = xgmac_remove, };module_platform_driver (xgmac_driver);
Signature · 1 line
2.40.1
PATCH 14/54 net: ethernet: cavium: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +2 -3
@@ -1521,7 +1521,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)return result; } -static int octeon_mgmt_remove (struct platform_device *pdev) +static void octeon_mgmt_remove (struct platform_device *pdev) {struct net_device *netdev =platform_get_drvdata (pdev);struct octeon_mgmt *p =netdev_priv (netdev);
@@ -1529,7 +1529,6 @@ static int octeon_mgmt_remove(struct platform_device *pdev)unregister_netdev (netdev);of_node_put (p->phy_np);free_netdev (netdev); -return 0 ; }static const struct of_device_id octeon_mgmt_match[] = {
@@ -1546,7 +1545,7 @@ static struct platform_driver octeon_mgmt_driver = { .of_match_table = octeon_mgmt_match, }, .probe = octeon_mgmt_probe, - .remove = octeon_mgmt_remove, + .remove_new = octeon_mgmt_remove, };module_platform_driver (octeon_mgmt_driver);
Signature · 1 line
2.40.1
PATCH 15/54 net: ethernet: cirrus: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/cirrus/cs89x0.c | 5 ++--- drivers/net/ethernet/cirrus/ep93xx_eth.c | 8 +++----- drivers/net/ethernet/cirrus/mac89x0.c | 5 ++--- 3 files changed, 7 insertions(+), 11 deletions(-)
drivers/net/ethernet/cirrus/cs89x0.c +2 -3
@@ -1879,7 +1879,7 @@ static int __init cs89x0_platform_probe(struct platform_device *pdev)return err; } -static int cs89x0_platform_remove (struct platform_device *pdev) +static void cs89x0_platform_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);
@@ -1889,7 +1889,6 @@ static int cs89x0_platform_remove(struct platform_device *pdev)*/ unregister_netdev (dev);free_netdev (dev); -return 0 ; }static const struct of_device_id __maybe_unused cs89x0_match[] = {
@@ -1904,7 +1903,7 @@ static struct platform_driver cs89x0_driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(cs89x0_match), }, - .remove = cs89x0_platform_remove, + .remove_new = cs89x0_platform_remove, };module_platform_driver_probe (cs89x0_driver, cs89x0_platform_probe);
drivers/net/ethernet/cirrus/ep93xx_eth.c +3 -5
@@ -757,7 +757,7 @@ static struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) } -static int ep93xx_eth_remove (struct platform_device *pdev) +static void ep93xx_eth_remove (struct platform_device *pdev) {struct net_device *dev;struct ep93xx_priv *ep;
@@ -765,7 +765,7 @@ static int ep93xx_eth_remove(struct platform_device *pdev) dev =platform_get_drvdata (pdev);if (dev ==NULL ) -return 0 ; +return ; ep =netdev_priv (dev);
@@ -782,8 +782,6 @@ static int ep93xx_eth_remove(struct platform_device *pdev) }free_netdev (dev); - -return 0 ; }static int ep93xx_eth_probe (struct platform_device *pdev)
@@ -862,7 +860,7 @@ static int ep93xx_eth_probe(struct platform_device *pdev)static struct platform_driver ep93xx_eth_driver = { .probe = ep93xx_eth_probe, - .remove = ep93xx_eth_remove, + .remove_new = ep93xx_eth_remove, .driver = { .name ="ep93xx-eth" , },
drivers/net/ethernet/cirrus/mac89x0.c +2 -3
@@ -556,19 +556,18 @@ static int set_mac_address(struct net_device *dev, void *addr)MODULE_LICENSE ("GPL" ); -static int mac89x0_device_remove (struct platform_device *pdev) +static void mac89x0_device_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);unregister_netdev (dev);nubus_writew (0 , dev->base_addr +ADD_PORT );free_netdev (dev); -return 0 ; }static struct platform_driver mac89x0_platform_driver = { .probe = mac89x0_device_probe, - .remove = mac89x0_device_remove, + .remove_new = mac89x0_device_remove, .driver = { .name ="mac89x0" , },
Signature · 1 line
2.40.1
PATCH 16/54 net: ethernet: cortina: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/cortina/gemini.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/cortina/gemini.c +4 -8
@@ -2518,13 +2518,11 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)return ret; } -static int gemini_ethernet_port_remove (struct platform_device *pdev) +static void gemini_ethernet_port_remove (struct platform_device *pdev) {struct gemini_ethernet_port *port =platform_get_drvdata (pdev);gemini_port_remove (port); - -return 0 ; }static const struct of_device_id gemini_ethernet_port_of_match[] = {
@@ -2541,7 +2539,7 @@ static struct platform_driver gemini_ethernet_port_driver = { .of_match_table = gemini_ethernet_port_of_match, }, .probe = gemini_ethernet_port_probe, - .remove = gemini_ethernet_port_remove, + .remove_new = gemini_ethernet_port_remove, };static int gemini_ethernet_probe (struct platform_device *pdev)
@@ -2583,14 +2581,12 @@ static int gemini_ethernet_probe(struct platform_device *pdev)return devm_of_platform_populate (dev); } -static int gemini_ethernet_remove (struct platform_device *pdev) +static void gemini_ethernet_remove (struct platform_device *pdev) {struct gemini_ethernet *geth =platform_get_drvdata (pdev);geth_cleanup_freeq (geth); geth->initialized = false; - -return 0 ; }static const struct of_device_id gemini_ethernet_of_match[] = {
@@ -2607,7 +2603,7 @@ static struct platform_driver gemini_ethernet_driver = { .of_match_table = gemini_ethernet_of_match, }, .probe = gemini_ethernet_probe, - .remove = gemini_ethernet_remove, + .remove_new = gemini_ethernet_remove, };static int __init gemini_ethernet_module_init (void )
Signature · 1 line
2.40.1
PATCH 17/54 net: ethernet: davicom: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/davicom/dm9000.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/davicom/dm9000.c +2 -4
@@ -1770,8 +1770,7 @@ static const struct dev_pm_ops dm9000_drv_pm_ops = { .resume = dm9000_drv_resume, }; -static int -dm9000_drv_remove (struct platform_device *pdev) +static void dm9000_drv_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct board_info *dm =to_dm9000_board (ndev);
@@ -1783,7 +1782,6 @@ dm9000_drv_remove(struct platform_device *pdev)regulator_disable (dm->power_supply);dev_dbg (&pdev->dev,"released and freed device\n" ); -return 0 ; }#ifdef CONFIG_OF
@@ -1801,7 +1799,7 @@ static struct platform_driver dm9000_driver = { .of_match_table = of_match_ptr(dm9000_of_matches), }, .probe = dm9000_probe, - .remove = dm9000_drv_remove, + .remove_new = dm9000_drv_remove, };module_platform_driver (dm9000_driver);
Signature · 1 line
2.40.1
PATCH 18/54 net: ethernet: dnet: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/dnet.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/dnet.c +2 -4
@@ -841,7 +841,7 @@ static int dnet_probe(struct platform_device *pdev)return err; } -static int dnet_remove (struct platform_device *pdev) +static void dnet_remove (struct platform_device *pdev) {struct net_device *dev;
@@ -859,13 +859,11 @@ static int dnet_remove(struct platform_device *pdev)free_irq (dev->irq, dev);free_netdev (dev); } - -return 0 ; }static struct platform_driver dnet_driver = { .probe = dnet_probe, - .remove = dnet_remove, + .remove_new = dnet_remove, .driver = { .name ="dnet" , },
Signature · 1 line
2.40.1
PATCH 19/54 net: ethernet: engleder: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/engleder/tsnep_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/engleder/tsnep_main.c +2 -4
@@ -2577,7 +2577,7 @@ static int tsnep_probe(struct platform_device *pdev)return retval; } -static int tsnep_remove (struct platform_device *pdev) +static void tsnep_remove (struct platform_device *pdev) {struct tsnep_adapter *adapter =platform_get_drvdata (pdev);
@@ -2593,8 +2593,6 @@ static int tsnep_remove(struct platform_device *pdev)mdiobus_unregister (adapter->mdiobus);tsnep_disable_irq (adapter,ECM_INT_ALL ); - -return 0 ; }static const struct of_device_id tsnep_of_match[] = {
@@ -2609,7 +2607,7 @@ static struct platform_driver tsnep_driver = { .of_match_table = tsnep_of_match, }, .probe = tsnep_probe, - .remove = tsnep_remove, + .remove_new = tsnep_remove, };module_platform_driver (tsnep_driver);
Signature · 1 line
2.40.1
PATCH 20/54 net: ethernet: ethoc: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/ethoc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/ethoc.c +2 -4
@@ -1254,7 +1254,7 @@ static int ethoc_probe(struct platform_device *pdev)* ethoc_remove - shutdown OpenCores ethernet MAC * @pdev: platform device */ -static int ethoc_remove (struct platform_device *pdev) +static void ethoc_remove (struct platform_device *pdev) {struct net_device *netdev =platform_get_drvdata (pdev);struct ethoc *priv =netdev_priv (netdev);
@@ -1271,8 +1271,6 @@ static int ethoc_remove(struct platform_device *pdev)unregister_netdev (netdev);free_netdev (netdev); } - -return 0 ; }#ifdef CONFIG_PM
@@ -1298,7 +1296,7 @@ MODULE_DEVICE_TABLE(of, ethoc_match);static struct platform_driver ethoc_driver = { .probe = ethoc_probe, - .remove = ethoc_remove, + .remove_new = ethoc_remove, .suspend = ethoc_suspend, .resume = ethoc_resume, .driver = {
Signature · 1 line
2.40.1
PATCH 21/54 net: ethernet: faraday: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/faraday/ftgmac100.c | 5 ++--- drivers/net/ethernet/faraday/ftmac100.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/faraday/ftgmac100.c +2 -3
@@ -2012,7 +2012,7 @@ static int ftgmac100_probe(struct platform_device *pdev)return err; } -static int ftgmac100_remove (struct platform_device *pdev) +static void ftgmac100_remove (struct platform_device *pdev) {struct net_device *netdev;struct ftgmac100 *priv;
@@ -2040,7 +2040,6 @@ static int ftgmac100_remove(struct platform_device *pdev)netif_napi_del (&priv->napi);free_netdev (netdev); -return 0 ; }static const struct of_device_id ftgmac100_of_match[] = {
@@ -2051,7 +2050,7 @@ MODULE_DEVICE_TABLE(of, ftgmac100_of_match);static struct platform_driver ftgmac100_driver = { .probe = ftgmac100_probe, - .remove = ftgmac100_remove, + .remove_new = ftgmac100_remove, .driver = { .name =DRV_NAME , .of_match_table = ftgmac100_of_match,
drivers/net/ethernet/faraday/ftmac100.c +2 -3
@@ -1219,7 +1219,7 @@ static int ftmac100_probe(struct platform_device *pdev)return err; } -static int ftmac100_remove (struct platform_device *pdev) +static void ftmac100_remove (struct platform_device *pdev) {struct net_device *netdev;struct ftmac100 *priv;
@@ -1234,7 +1234,6 @@ static int ftmac100_remove(struct platform_device *pdev)netif_napi_del (&priv->napi);free_netdev (netdev); -return 0 ; }static const struct of_device_id ftmac100_of_ids[] = {
@@ -1244,7 +1243,7 @@ static const struct of_device_id ftmac100_of_ids[] = {static struct platform_driver ftmac100_driver = { .probe = ftmac100_probe, - .remove = ftmac100_remove, + .remove_new = ftmac100_remove, .driver = { .name =DRV_NAME , .of_match_table = ftmac100_of_ids
Signature · 1 line
2.40.1
PATCH 22/54 net: ethernet: hisilicon: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/hisilicon/hip04_eth.c | 6 ++---- drivers/net/ethernet/hisilicon/hisi_femac.c | 6 ++---- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 6 ++---- drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c | 6 ++---- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 5 ++--- drivers/net/ethernet/hisilicon/hns_mdio.c | 5 ++--- 6 files changed, 12 insertions(+), 22 deletions(-)
drivers/net/ethernet/hisilicon/hip04_eth.c +2 -4
@@ -1021,7 +1021,7 @@ static int hip04_mac_probe(struct platform_device *pdev)return ret; } -static int hip04_remove (struct platform_device *pdev) +static void hip04_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct hip04_priv *priv =netdev_priv (ndev);
@@ -1035,8 +1035,6 @@ static int hip04_remove(struct platform_device *pdev)of_node_put (priv->phy_node);cancel_work_sync (&priv->tx_timeout_task);free_netdev (ndev); - -return 0 ; }static const struct of_device_id hip04_mac_match[] = {
@@ -1048,7 +1046,7 @@ MODULE_DEVICE_TABLE(of, hip04_mac_match);static struct platform_driver hip04_mac_driver = { .probe = hip04_mac_probe, - .remove = hip04_remove, + .remove_new = hip04_remove, .driver = { .name =DRV_NAME , .of_match_table = hip04_mac_match,
drivers/net/ethernet/hisilicon/hisi_femac.c +2 -4
@@ -893,7 +893,7 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)return ret; } -static int hisi_femac_drv_remove (struct platform_device *pdev) +static void hisi_femac_drv_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct hisi_femac_priv *priv =netdev_priv (ndev);
@@ -904,8 +904,6 @@ static int hisi_femac_drv_remove(struct platform_device *pdev)phy_disconnect (ndev->phydev);clk_disable_unprepare (priv->clk);free_netdev (ndev); - -return 0 ; }#ifdef CONFIG_PM
@@ -961,7 +959,7 @@ static struct platform_driver hisi_femac_driver = { .of_match_table = hisi_femac_match, }, .probe = hisi_femac_drv_probe, - .remove = hisi_femac_drv_remove, + .remove_new = hisi_femac_drv_remove, #ifdef CONFIG_PM .suspend = hisi_femac_drv_suspend, .resume = hisi_femac_drv_resume,
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c +2 -4
@@ -1282,7 +1282,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)return ret; } -static int hix5hd2_dev_remove (struct platform_device *pdev) +static void hix5hd2_dev_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct hix5hd2_priv *priv =netdev_priv (ndev);
@@ -1298,8 +1298,6 @@ static int hix5hd2_dev_remove(struct platform_device *pdev)of_node_put (priv->phy_node);cancel_work_sync (&priv->tx_timeout_task);free_netdev (ndev); - -return 0 ; }static const struct of_device_id hix5hd2_of_match[] = {
@@ -1319,7 +1317,7 @@ static struct platform_driver hix5hd2_dev_driver = { .of_match_table = hix5hd2_of_match, }, .probe = hix5hd2_dev_probe, - .remove = hix5hd2_dev_remove, + .remove_new = hix5hd2_dev_remove, };module_platform_driver (hix5hd2_dev_driver);
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +2 -4
@@ -3007,7 +3007,7 @@ static int hns_dsaf_probe(struct platform_device *pdev)* hns_dsaf_remove - remove dsaf dev * @pdev: dasf platform device */ -static int hns_dsaf_remove (struct platform_device *pdev) +static void hns_dsaf_remove (struct platform_device *pdev) {struct dsaf_device *dsaf_dev =dev_get_drvdata (&pdev->dev);
@@ -3020,8 +3020,6 @@ static int hns_dsaf_remove(struct platform_device *pdev)hns_dsaf_free (dsaf_dev);hns_dsaf_free_dev (dsaf_dev); - -return 0 ; }static const struct of_device_id g_dsaf_match[] = {
@@ -3033,7 +3031,7 @@ MODULE_DEVICE_TABLE(of, g_dsaf_match);static struct platform_driver g_dsaf_driver = { .probe = hns_dsaf_probe, - .remove = hns_dsaf_remove, + .remove_new = hns_dsaf_remove, .driver = { .name =DSAF_DRV_NAME , .of_match_table = g_dsaf_match,
drivers/net/ethernet/hisilicon/hns/hns_enet.c +2 -3
@@ -2384,7 +2384,7 @@ static int hns_nic_dev_probe(struct platform_device *pdev)return ret; } -static int hns_nic_dev_remove (struct platform_device *pdev) +static void hns_nic_dev_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct hns_nic_priv *priv =netdev_priv (ndev);
@@ -2413,7 +2413,6 @@ static int hns_nic_dev_remove(struct platform_device *pdev)of_node_put (to_of_node (priv->fwnode));free_netdev (ndev); -return 0 ; }static const struct of_device_id hns_enet_of_match[] = {
@@ -2431,7 +2430,7 @@ static struct platform_driver hns_nic_dev_driver = { .acpi_match_table = ACPI_PTR(hns_enet_acpi_match), }, .probe = hns_nic_dev_probe, - .remove = hns_nic_dev_remove, + .remove_new = hns_nic_dev_remove, };module_platform_driver (hns_nic_dev_driver);
drivers/net/ethernet/hisilicon/hns_mdio.c +2 -3
@@ -610,7 +610,7 @@ static int hns_mdio_probe(struct platform_device *pdev)* * Return 0 on success, negative on failure */ -static int hns_mdio_remove (struct platform_device *pdev) +static void hns_mdio_remove (struct platform_device *pdev) {struct mii_bus *bus;
@@ -618,7 +618,6 @@ static int hns_mdio_remove(struct platform_device *pdev)mdiobus_unregister (bus);platform_set_drvdata (pdev,NULL ); -return 0 ; }static const struct of_device_id hns_mdio_match[] = {
@@ -636,7 +635,7 @@ MODULE_DEVICE_TABLE(acpi, hns_mdio_acpi_match);static struct platform_driver hns_mdio_driver = { .probe = hns_mdio_probe, - .remove = hns_mdio_remove, + .remove_new = hns_mdio_remove, .driver = { .name =MDIO_DRV_NAME , .of_match_table = hns_mdio_match,
Signature · 1 line
2.40.1
PATCH 23/54 net: ethernet: i825xx: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/i825xx/sni_82596.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/i825xx/sni_82596.c +2 -3
@@ -153,7 +153,7 @@ static int sni_82596_probe(struct platform_device *dev)return retval; } -static int sni_82596_driver_remove (struct platform_device *pdev) +static void sni_82596_driver_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct i596_private *lp =netdev_priv (dev);
@@ -164,12 +164,11 @@ static int sni_82596_driver_remove(struct platform_device *pdev)iounmap (lp->ca);iounmap (lp->mpu_port);free_netdev (dev); -return 0 ; }static struct platform_driver sni_82596_driver = { .probe = sni_82596_probe, - .remove = sni_82596_driver_remove, + .remove_new = sni_82596_driver_remove, .driver = { .name = sni_82596_string, },
Signature · 1 line
2.40.1
PATCH 24/54 net: ethernet: ibm: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/ibm/ehea/ehea_main.c | 8 +++----- drivers/net/ethernet/ibm/emac/core.c | 6 ++---- drivers/net/ethernet/ibm/emac/mal.c | 6 ++---- drivers/net/ethernet/ibm/emac/rgmii.c | 6 ++---- drivers/net/ethernet/ibm/emac/tah.c | 6 ++---- drivers/net/ethernet/ibm/emac/zmii.c | 6 ++---- 6 files changed, 13 insertions(+), 25 deletions(-)
drivers/net/ethernet/ibm/ehea/ehea_main.c +3 -5
@@ -90,7 +90,7 @@ static struct ehea_bcmc_reg_array ehea_bcmc_regs;static int ehea_probe_adapter (struct platform_device *dev); -static int ehea_remove (struct platform_device *dev); +static void ehea_remove (struct platform_device *dev);static const struct of_device_id ehea_module_device_table[] = { {
@@ -121,7 +121,7 @@ static struct platform_driver ehea_driver = { .of_match_table = ehea_device_table, }, .probe = ehea_probe_adapter, - .remove = ehea_remove, + .remove_new = ehea_remove, };void ehea_dump (void *adr,int len,char *msg)
@@ -3471,7 +3471,7 @@ static int ehea_probe_adapter(struct platform_device *dev)return ret; } -static int ehea_remove (struct platform_device *dev) +static void ehea_remove (struct platform_device *dev) {struct ehea_adapter *adapter =platform_get_drvdata (dev);int i;
@@ -3492,8 +3492,6 @@ static int ehea_remove(struct platform_device *dev)list_del (&adapter->list);ehea_update_firmware_handles (); - -return 0 ; }static int check_module_parm (void )
drivers/net/ethernet/ibm/emac/core.c +2 -4
@@ -3253,7 +3253,7 @@ static int emac_probe(struct platform_device *ofdev)return err; } -static int emac_remove (struct platform_device *ofdev) +static void emac_remove (struct platform_device *ofdev) {struct emac_instance *dev =platform_get_drvdata (ofdev);
@@ -3290,8 +3290,6 @@ static int emac_remove(struct platform_device *ofdev)irq_dispose_mapping (dev->emac_irq);free_netdev (dev->ndev); - -return 0 ; }/* XXX Features in here should be replaced by properties... */
@@ -3319,7 +3317,7 @@ static struct platform_driver emac_driver = { .of_match_table = emac_match, }, .probe = emac_probe, - .remove = emac_remove, + .remove_new = emac_remove, };static void __init emac_make_bootlist (void )
drivers/net/ethernet/ibm/emac/mal.c +2 -4
@@ -711,7 +711,7 @@ static int mal_probe(struct platform_device *ofdev)return err; } -static int mal_remove (struct platform_device *ofdev) +static void mal_remove (struct platform_device *ofdev) {struct mal_instance *mal =platform_get_drvdata (ofdev);
@@ -740,8 +740,6 @@ static int mal_remove(struct platform_device *ofdev) NUM_RX_BUFF * mal->num_rx_chans), mal->bd_virt, mal->bd_dma);kfree (mal); - -return 0 ; } static const struct of_device_id mal_platform_match[] =
@@ -770,7 +768,7 @@ static struct platform_driver mal_of_driver = { .of_match_table = mal_platform_match, }, .probe = mal_probe, - .remove = mal_remove, + .remove_new = mal_remove, };int __init mal_init (void )
drivers/net/ethernet/ibm/emac/rgmii.c +2 -4
@@ -273,7 +273,7 @@ static int rgmii_probe(struct platform_device *ofdev)return rc; } -static int rgmii_remove (struct platform_device *ofdev) +static void rgmii_remove (struct platform_device *ofdev) {struct rgmii_instance *dev =platform_get_drvdata (ofdev);
@@ -281,8 +281,6 @@ static int rgmii_remove(struct platform_device *ofdev)iounmap (dev->base);kfree (dev); - -return 0 ; } static const struct of_device_id rgmii_match[] =
@@ -302,7 +300,7 @@ static struct platform_driver rgmii_driver = { .of_match_table = rgmii_match, }, .probe = rgmii_probe, - .remove = rgmii_remove, + .remove_new = rgmii_remove, };int __init rgmii_init (void )
drivers/net/ethernet/ibm/emac/tah.c +2 -4
@@ -130,7 +130,7 @@ static int tah_probe(struct platform_device *ofdev)return rc; } -static int tah_remove (struct platform_device *ofdev) +static void tah_remove (struct platform_device *ofdev) {struct tah_instance *dev =platform_get_drvdata (ofdev);
@@ -138,8 +138,6 @@ static int tah_remove(struct platform_device *ofdev)iounmap (dev->base);kfree (dev); - -return 0 ; } static const struct of_device_id tah_match[] =
@@ -160,7 +158,7 @@ static struct platform_driver tah_driver = { .of_match_table = tah_match, }, .probe = tah_probe, - .remove = tah_remove, + .remove_new = tah_remove, };int __init tah_init (void )
drivers/net/ethernet/ibm/emac/zmii.c +2 -4
@@ -278,7 +278,7 @@ static int zmii_probe(struct platform_device *ofdev)return rc; } -static int zmii_remove (struct platform_device *ofdev) +static void zmii_remove (struct platform_device *ofdev) {struct zmii_instance *dev =platform_get_drvdata (ofdev);
@@ -286,8 +286,6 @@ static int zmii_remove(struct platform_device *ofdev)iounmap (dev->base);kfree (dev); - -return 0 ; } static const struct of_device_id zmii_match[] =
@@ -308,7 +306,7 @@ static struct platform_driver zmii_driver = { .of_match_table = zmii_match, }, .probe = zmii_probe, - .remove = zmii_remove, + .remove_new = zmii_remove, };int __init zmii_init (void )
Signature · 1 line
2.40.1
PATCH 25/54 net: ethernet: korina: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/korina.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/korina.c +2 -4
@@ -1380,13 +1380,11 @@ static int korina_probe(struct platform_device *pdev)return rc; } -static int korina_remove (struct platform_device *pdev) +static void korina_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);unregister_netdev (dev); - -return 0 ; }#ifdef CONFIG_OF
@@ -1405,7 +1403,7 @@ static struct platform_driver korina_driver = { .of_match_table = of_match_ptr(korina_match), }, .probe = korina_probe, - .remove = korina_remove, + .remove_new = korina_remove, };module_platform_driver (korina_driver);
Signature · 1 line
2.40.1
PATCH 26/54 net: ethernet: lantiq_etop: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/lantiq_etop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/lantiq_etop.c +2 -4
@@ -721,8 +721,7 @@ ltq_etop_probe(struct platform_device *pdev)return err; } -static int -ltq_etop_remove (struct platform_device *pdev) +static void ltq_etop_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);
@@ -732,11 +731,10 @@ ltq_etop_remove(struct platform_device *pdev)ltq_etop_mdio_cleanup (dev);unregister_netdev (dev); } -return 0 ; }static struct platform_driver ltq_mii_driver = { - .remove = ltq_etop_remove, + .remove_new = ltq_etop_remove, .driver = { .name ="ltq_etop" , },
Signature · 1 line
2.40.1
PATCH 27/54 net: ethernet: lantiq_xrx200: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/lantiq_xrx200.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/lantiq_xrx200.c +2 -4
@@ -641,7 +641,7 @@ static int xrx200_probe(struct platform_device *pdev)return err; } -static int xrx200_remove (struct platform_device *pdev) +static void xrx200_remove (struct platform_device *pdev) {struct xrx200_priv *priv =platform_get_drvdata (pdev);struct net_device *net_dev = priv->net_dev;
@@ -659,8 +659,6 @@ static int xrx200_remove(struct platform_device *pdev)/* shut down hardware */ xrx200_hw_cleanup (priv); - -return 0 ; }static const struct of_device_id xrx200_match[] = {
@@ -671,7 +669,7 @@ MODULE_DEVICE_TABLE(of, xrx200_match);static struct platform_driver xrx200_driver = { .probe = xrx200_probe, - .remove = xrx200_remove, + .remove_new = xrx200_remove, .driver = { .name ="lantiq,xrx200-net" , .of_match_table = xrx200_match,
Signature · 1 line
2.40.1
PATCH 28/54 net: ethernet: litex: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/litex/litex_liteeth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/litex/litex_liteeth.c +2 -4
@@ -294,13 +294,11 @@ static int liteeth_probe(struct platform_device *pdev)return 0 ; } -static int liteeth_remove (struct platform_device *pdev) +static void liteeth_remove (struct platform_device *pdev) {struct net_device *netdev =platform_get_drvdata (pdev);unregister_netdev (netdev); - -return 0 ; }static const struct of_device_id liteeth_of_match[] = {
@@ -311,7 +309,7 @@ MODULE_DEVICE_TABLE(of, liteeth_of_match);static struct platform_driver liteeth_driver = { .probe = liteeth_probe, - .remove = liteeth_remove, + .remove_new = liteeth_remove, .driver = { .name =DRV_NAME , .of_match_table = liteeth_of_match,
Signature · 1 line
2.40.1
Re: [PATCH net-next 28/54] net: ethernet: litex: Convert to platform remove callback returning void
Quoted 11 lines · Uwe Kleine-König
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.
Thanks,
--G
Quoted 36 lines
Signed-off-by Uwe Kleine-König <[email protected]>--- drivers/net/ethernet/litex/litex_liteeth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/ethernet/litex/litex_liteeth.c +2
-4@@ -294,13 +294,11 @@ static int liteeth_probe(struct platform_device *pdev)return 0 ; } -static int liteeth_remove (struct platform_device *pdev) +static void liteeth_remove (struct platform_device *pdev) {struct net_device *netdev =platform_get_drvdata (pdev);unregister_netdev (netdev); - -return 0 ; }static const struct of_device_id liteeth_of_match[] = {@@ -311,7 +309,7 @@ MODULE_DEVICE_TABLE(of, liteeth_of_match);static struct platform_driver liteeth_driver = { .probe = liteeth_probe, - .remove = liteeth_remove, + .remove_new = liteeth_remove, .driver = { .name =DRV_NAME , .of_match_table = liteeth_of_match,Signature · 1 line
2.40.1
PATCH 29/54 net: ethernet: marvell: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 11 ++++------- drivers/net/ethernet/marvell/mvmdio.c | 6 ++---- drivers/net/ethernet/marvell/mvneta.c | 6 ++---- drivers/net/ethernet/marvell/mvneta_bm.c | 6 ++---- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 8 +++----- drivers/net/ethernet/marvell/pxa168_eth.c | 5 ++--- 6 files changed, 15 insertions(+), 27 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +4 -7
@@ -2892,19 +2892,18 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)return ret; } -static int mv643xx_eth_shared_remove (struct platform_device *pdev) +static void mv643xx_eth_shared_remove (struct platform_device *pdev) {struct mv643xx_eth_shared_private *msp =platform_get_drvdata (pdev);mv643xx_eth_shared_of_remove ();if (!IS_ERR (msp->clk))clk_disable_unprepare (msp->clk); -return 0 ; }static struct platform_driver mv643xx_eth_shared_driver = { .probe = mv643xx_eth_shared_probe, - .remove = mv643xx_eth_shared_remove, + .remove_new = mv643xx_eth_shared_remove, .driver = { .name =MV643XX_ETH_SHARED_NAME , .of_match_table =of_match_ptr (mv643xx_eth_shared_ids),
@@ -3279,7 +3278,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)return err; } -static int mv643xx_eth_remove (struct platform_device *pdev) +static void mv643xx_eth_remove (struct platform_device *pdev) {struct mv643xx_eth_private *mp =platform_get_drvdata (pdev);struct net_device *dev = mp->dev;
@@ -3293,8 +3292,6 @@ static int mv643xx_eth_remove(struct platform_device *pdev)clk_disable_unprepare (mp->clk);free_netdev (mp->dev); - -return 0 ; }static void mv643xx_eth_shutdown (struct platform_device *pdev)
@@ -3311,7 +3308,7 @@ static void mv643xx_eth_shutdown(struct platform_device *pdev)static struct platform_driver mv643xx_eth_driver = { .probe = mv643xx_eth_probe, - .remove = mv643xx_eth_remove, + .remove_new = mv643xx_eth_remove, .shutdown = mv643xx_eth_shutdown, .driver = { .name =MV643XX_ETH_NAME ,
drivers/net/ethernet/marvell/mvmdio.c +2 -4
@@ -388,7 +388,7 @@ static int orion_mdio_probe(struct platform_device *pdev)return ret; } -static int orion_mdio_remove (struct platform_device *pdev) +static void orion_mdio_remove (struct platform_device *pdev) {struct mii_bus *bus =platform_get_drvdata (pdev);struct orion_mdio_dev *dev = bus->priv;
@@ -404,8 +404,6 @@ static int orion_mdio_remove(struct platform_device *pdev)clk_disable_unprepare (dev->clk[i]);clk_put (dev->clk[i]); } - -return 0 ; }static const struct of_device_id orion_mdio_match[] = {
@@ -426,7 +424,7 @@ MODULE_DEVICE_TABLE(acpi, orion_mdio_acpi_match);static struct platform_driver orion_mdio_driver = { .probe = orion_mdio_probe, - .remove = orion_mdio_remove, + .remove_new = orion_mdio_remove, .driver = { .name ="orion-mdio" , .of_match_table = orion_mdio_match,
drivers/net/ethernet/marvell/mvneta.c +2 -4
@@ -5725,7 +5725,7 @@ static int mvneta_probe(struct platform_device *pdev) }/* Device removal routine */ -static int mvneta_remove (struct platform_device *pdev) +static void mvneta_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct mvneta_port *pp =netdev_priv (dev);
@@ -5744,8 +5744,6 @@ static int mvneta_remove(struct platform_device *pdev) 1 << pp->id);mvneta_bm_put (pp->bm_priv); } - -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -5871,7 +5869,7 @@ MODULE_DEVICE_TABLE(of, mvneta_match);static struct platform_driver mvneta_driver = { .probe = mvneta_probe, - .remove = mvneta_remove, + .remove_new = mvneta_remove, .driver = { .name =MVNETA_DRIVER_NAME , .of_match_table = mvneta_match,
drivers/net/ethernet/marvell/mvneta_bm.c +2 -4
@@ -457,7 +457,7 @@ static int mvneta_bm_probe(struct platform_device *pdev)return err; } -static int mvneta_bm_remove (struct platform_device *pdev) +static void mvneta_bm_remove (struct platform_device *pdev) {struct mvneta_bm *priv =platform_get_drvdata (pdev);u8 all_ports_map =0xff ;
@@ -475,8 +475,6 @@ static int mvneta_bm_remove(struct platform_device *pdev)mvneta_bm_write (priv,MVNETA_BM_COMMAND_REG ,MVNETA_BM_STOP_MASK );clk_disable_unprepare (priv->clk); - -return 0 ; }static const struct of_device_id mvneta_bm_match[] = {
@@ -487,7 +485,7 @@ MODULE_DEVICE_TABLE(of, mvneta_bm_match);static struct platform_driver mvneta_bm_driver = { .probe = mvneta_bm_probe, - .remove = mvneta_bm_remove, + .remove_new = mvneta_bm_remove, .driver = { .name =MVNETA_BM_DRIVER_NAME , .of_match_table = mvneta_bm_match,
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +3 -5
@@ -7662,7 +7662,7 @@ static int mvpp2_probe(struct platform_device *pdev)return err; } -static int mvpp2_remove (struct platform_device *pdev) +static void mvpp2_remove (struct platform_device *pdev) {struct mvpp2 *priv =platform_get_drvdata (pdev);struct fwnode_handle *fwnode = pdev->dev.fwnode;
@@ -7700,15 +7700,13 @@ static int mvpp2_remove(struct platform_device *pdev) }if (is_acpi_node (port_fwnode)) -return 0 ; +return ;clk_disable_unprepare (priv->axi_clk);clk_disable_unprepare (priv->mg_core_clk);clk_disable_unprepare (priv->mg_clk);clk_disable_unprepare (priv->pp_clk);clk_disable_unprepare (priv->gop_clk); - -return 0 ; }static const struct of_device_id mvpp2_match[] = {
@@ -7734,7 +7732,7 @@ MODULE_DEVICE_TABLE(acpi, mvpp2_acpi_match);static struct platform_driver mvpp2_driver = { .probe = mvpp2_probe, - .remove = mvpp2_remove, + .remove_new = mvpp2_remove, .driver = { .name =MVPP2_DRIVER_NAME , .of_match_table = mvpp2_match,
drivers/net/ethernet/marvell/pxa168_eth.c +2 -3
@@ -1528,7 +1528,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)return err; } -static int pxa168_eth_remove (struct platform_device *pdev) +static void pxa168_eth_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct pxa168_eth_private *pep =netdev_priv (dev);
@@ -1547,7 +1547,6 @@ static int pxa168_eth_remove(struct platform_device *pdev)mdiobus_free (pep->smi_bus);unregister_netdev (dev);free_netdev (dev); -return 0 ; }static void pxa168_eth_shutdown (struct platform_device *pdev)
@@ -1580,7 +1579,7 @@ MODULE_DEVICE_TABLE(of, pxa168_eth_of_match);static struct platform_driver pxa168_eth_driver = { .probe = pxa168_eth_probe, - .remove = pxa168_eth_remove, + .remove_new = pxa168_eth_remove, .shutdown = pxa168_eth_shutdown, .resume = pxa168_eth_resume, .suspend = pxa168_eth_suspend,
Signature · 1 line
2.40.1
PATCH 30/54 net: ethernet: mediatek: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +2 -4
@@ -5002,7 +5002,7 @@ static int mtk_probe(struct platform_device *pdev)return err; } -static int mtk_remove (struct platform_device *pdev) +static void mtk_remove (struct platform_device *pdev) {struct mtk_eth *eth =platform_get_drvdata (pdev);struct mtk_mac *mac;
@@ -5024,8 +5024,6 @@ static int mtk_remove(struct platform_device *pdev)netif_napi_del (ð->rx_napi);mtk_cleanup (eth);mtk_mdio_cleanup (eth); - -return 0 ; }static const struct mtk_soc_data mt2701_data = {
@@ -5226,7 +5224,7 @@ MODULE_DEVICE_TABLE(of, of_mtk_match);static struct platform_driver mtk_driver = { .probe = mtk_probe, - .remove = mtk_remove, + .remove_new = mtk_remove, .driver = { .name ="mtk_soc_eth" , .of_match_table = of_mtk_match,
Signature · 1 line
2.40.1
PATCH 31/54 net: ethernet: mellanox: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +2 -4
@@ -471,7 +471,7 @@ static int mlxbf_gige_probe(struct platform_device *pdev)return err; } -static int mlxbf_gige_remove (struct platform_device *pdev) +static void mlxbf_gige_remove (struct platform_device *pdev) {struct mlxbf_gige *priv =platform_get_drvdata (pdev);
@@ -479,8 +479,6 @@ static int mlxbf_gige_remove(struct platform_device *pdev)phy_disconnect (priv->netdev->phydev);mlxbf_gige_mdio_remove (priv);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static void mlxbf_gige_shutdown (struct platform_device *pdev)
@@ -499,7 +497,7 @@ MODULE_DEVICE_TABLE(acpi, mlxbf_gige_acpi_match);static struct platform_driver mlxbf_gige_driver = { .probe = mlxbf_gige_probe, - .remove = mlxbf_gige_remove, + .remove_new = mlxbf_gige_remove, .shutdown = mlxbf_gige_shutdown, .driver = { .name =KBUILD_MODNAME ,
Signature · 1 line
2.40.1
Re: [PATCH net-next 31/54] net: ethernet: mellanox: Convert to platform remove callback returning void
Quoted 9 lines · Uwe Kleine-König
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().
Quoted 8 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>--- drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Thanks,
PATCH 32/54 net: ethernet: micrel: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/micrel/ks8842.c | 5 ++--- drivers/net/ethernet/micrel/ks8851_par.c | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/net/ethernet/micrel/ks8842.c +2 -3
@@ -1228,7 +1228,7 @@ static int ks8842_probe(struct platform_device *pdev)return err; } -static int ks8842_remove (struct platform_device *pdev) +static void ks8842_remove (struct platform_device *pdev) {struct net_device *netdev =platform_get_drvdata (pdev);struct ks8842_adapter *adapter =netdev_priv (netdev);
@@ -1239,7 +1239,6 @@ static int ks8842_remove(struct platform_device *pdev)iounmap (adapter->hw_addr);free_netdev (netdev);release_mem_region (iomem->start,resource_size (iomem)); -return 0 ; }
@@ -1248,7 +1247,7 @@ static struct platform_driver ks8842_platform_driver = { .name = DRV_NAME, }, .probe = ks8842_probe, - .remove = ks8842_remove, + .remove_new = ks8842_remove, };module_platform_driver (ks8842_platform_driver);
drivers/net/ethernet/micrel/ks8851_par.c +2 -4
@@ -327,11 +327,9 @@ static int ks8851_probe_par(struct platform_device *pdev)return ks8851_probe_common (netdev, dev, msg_enable); } -static int ks8851_remove_par (struct platform_device *pdev) +static void ks8851_remove_par (struct platform_device *pdev) {ks8851_remove_common (&pdev->dev); - -return 0 ; }static const struct of_device_id ks8851_match_table[] = {
@@ -347,7 +345,7 @@ static struct platform_driver ks8851_driver = { .pm = &ks8851_pm_ops, }, .probe = ks8851_probe_par, - .remove = ks8851_remove_par, + .remove_new = ks8851_remove_par, };module_platform_driver (ks8851_driver);
Signature · 1 line
2.40.1
PATCH 33/54 net: ethernet: microchip: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 ++---- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/microchip/lan966x/lan966x_main.c +2 -4
@@ -1261,7 +1261,7 @@ static int lan966x_probe(struct platform_device *pdev)return err; } -static int lan966x_remove (struct platform_device *pdev) +static void lan966x_remove (struct platform_device *pdev) {struct lan966x *lan966x =platform_get_drvdata (pdev);
@@ -1280,13 +1280,11 @@ static int lan966x_remove(struct platform_device *pdev)lan966x_ptp_deinit (lan966x);debugfs_remove_recursive (lan966x->debugfs_root); - -return 0 ; }static struct platform_driver lan966x_driver = { .probe = lan966x_probe, - .remove = lan966x_remove, + .remove_new = lan966x_remove, .driver = { .name ="lan966x-switch" , .of_match_table = lan966x_match,
drivers/net/ethernet/microchip/sparx5/sparx5_main.c +2 -4
@@ -911,7 +911,7 @@ static int mchp_sparx5_probe(struct platform_device *pdev)return err; } -static int mchp_sparx5_remove (struct platform_device *pdev) +static void mchp_sparx5_remove (struct platform_device *pdev) {struct sparx5 *sparx5 =platform_get_drvdata (pdev);
@@ -931,8 +931,6 @@ static int mchp_sparx5_remove(struct platform_device *pdev)/* Unregister netdevs */ sparx5_unregister_notifier_blocks (sparx5);destroy_workqueue (sparx5->mact_queue); - -return 0 ; }static const struct of_device_id mchp_sparx5_match[] = {
@@ -943,7 +941,7 @@ MODULE_DEVICE_TABLE(of, mchp_sparx5_match);static struct platform_driver mchp_sparx5_driver = { .probe = mchp_sparx5_probe, - .remove = mchp_sparx5_remove, + .remove_new = mchp_sparx5_remove, .driver = { .name ="sparx5-switch" , .of_match_table = mchp_sparx5_match,
Signature · 1 line
2.40.1
PATCH 34/54 net: ethernet: moxa:: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/moxa/moxart_ether.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/moxa/moxart_ether.c +2 -4
@@ -558,7 +558,7 @@ static int moxart_mac_probe(struct platform_device *pdev)return ret; } -static int moxart_remove (struct platform_device *pdev) +static void moxart_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);
@@ -566,8 +566,6 @@ static int moxart_remove(struct platform_device *pdev)devm_free_irq (&pdev->dev, ndev->irq, ndev);moxart_mac_free_memory (ndev);free_netdev (ndev); - -return 0 ; }static const struct of_device_id moxart_mac_match[] = {
@@ -578,7 +576,7 @@ MODULE_DEVICE_TABLE(of, moxart_mac_match);static struct platform_driver moxart_mac_driver = { .probe = moxart_mac_probe, - .remove = moxart_remove, + .remove_new = moxart_remove, .driver = { .name ="moxart-ethernet" , .of_match_table = moxart_mac_match,
Signature · 1 line
2.40.1
PATCH 35/54 net: ethernet: mscc: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mscc/ocelot_vsc7514.c +2 -4
@@ -392,7 +392,7 @@ static int mscc_ocelot_probe(struct platform_device *pdev)return err; } -static int mscc_ocelot_remove (struct platform_device *pdev) +static void mscc_ocelot_remove (struct platform_device *pdev) {struct ocelot *ocelot =platform_get_drvdata (pdev);
@@ -408,13 +408,11 @@ static int mscc_ocelot_remove(struct platform_device *pdev)unregister_switchdev_notifier (&ocelot_switchdev_nb);unregister_netdevice_notifier (&ocelot_netdevice_nb);devlink_free (ocelot->devlink); - -return 0 ; }static struct platform_driver mscc_ocelot_driver = { .probe = mscc_ocelot_probe, - .remove = mscc_ocelot_remove, + .remove_new = mscc_ocelot_remove, .driver = { .name ="ocelot-switch" , .of_match_table = mscc_ocelot_match,
Signature · 1 line
2.40.1
PATCH 36/54 net: ethernet: natsemi: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/natsemi/jazzsonic.c | 6 ++---- drivers/net/ethernet/natsemi/macsonic.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/natsemi/jazzsonic.c +2 -4
@@ -227,7 +227,7 @@ MODULE_ALIAS("platform:jazzsonic");#include "sonic.c" -static int jazz_sonic_device_remove (struct platform_device *pdev) +static void jazz_sonic_device_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct sonic_local * lp =netdev_priv (dev);
@@ -237,13 +237,11 @@ static int jazz_sonic_device_remove(struct platform_device *pdev) lp->descriptors, lp->descriptors_laddr);release_mem_region (dev->base_addr,SONIC_MEM_SIZE );free_netdev (dev); - -return 0 ; }static struct platform_driver jazz_sonic_driver = { .probe = jazz_sonic_probe, - .remove = jazz_sonic_device_remove, + .remove_new = jazz_sonic_device_remove, .driver = { .name = jazz_sonic_string, },
drivers/net/ethernet/natsemi/macsonic.c +2 -4
@@ -532,7 +532,7 @@ MODULE_ALIAS("platform:macsonic");#include "sonic.c" -static int mac_sonic_platform_remove (struct platform_device *pdev) +static void mac_sonic_platform_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct sonic_local * lp =netdev_priv (dev);
@@ -541,13 +541,11 @@ static int mac_sonic_platform_remove(struct platform_device *pdev)dma_free_coherent (lp->device,SIZEOF_SONIC_DESC *SONIC_BUS_SCALE (lp->dma_bitmode), lp->descriptors, lp->descriptors_laddr);free_netdev (dev); - -return 0 ; }static struct platform_driver mac_sonic_platform_driver = { .probe = mac_sonic_platform_probe, - .remove = mac_sonic_platform_remove, + .remove_new = mac_sonic_platform_remove, .driver = { .name ="macsonic" , },
Signature · 1 line
2.40.1
PATCH 37/54 net: ethernet: natsemi: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/natsemi/xtsonic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/natsemi/xtsonic.c +2 -4
@@ -249,7 +249,7 @@ MODULE_DESCRIPTION("Xtensa XT2000 SONIC ethernet driver");#include "sonic.c" -static int xtsonic_device_remove (struct platform_device *pdev) +static void xtsonic_device_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct sonic_local *lp =netdev_priv (dev);
@@ -260,13 +260,11 @@ static int xtsonic_device_remove(struct platform_device *pdev) lp->descriptors, lp->descriptors_laddr);release_region (dev->base_addr,SONIC_MEM_SIZE );free_netdev (dev); - -return 0 ; }static struct platform_driver xtsonic_driver = { .probe = xtsonic_probe, - .remove = xtsonic_device_remove, + .remove_new = xtsonic_device_remove, .driver = { .name = xtsonic_string, },
Signature · 1 line
2.40.1
PATCH 38/54 net: ethernet: ni: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/ni/nixge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/ni/nixge.c +2 -4
@@ -1397,7 +1397,7 @@ static int nixge_probe(struct platform_device *pdev)return err; } -static int nixge_remove (struct platform_device *pdev) +static void nixge_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct nixge_priv *priv =netdev_priv (ndev);
@@ -1412,13 +1412,11 @@ static int nixge_remove(struct platform_device *pdev)mdiobus_unregister (priv->mii_bus);free_netdev (ndev); - -return 0 ; }static struct platform_driver nixge_driver = { .probe = nixge_probe, - .remove = nixge_remove, + .remove_new = nixge_remove, .driver = { .name ="nixge" , .of_match_table = nixge_dt_ids,
Signature · 1 line
2.40.1
PATCH 39/54 net: ethernet: nxp: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/nxp/lpc_eth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/nxp/lpc_eth.c +2 -4
@@ -1417,7 +1417,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)return ret; } -static int lpc_eth_drv_remove (struct platform_device *pdev) +static void lpc_eth_drv_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct netdata_local *pldat =netdev_priv (ndev);
@@ -1436,8 +1436,6 @@ static int lpc_eth_drv_remove(struct platform_device *pdev)clk_disable_unprepare (pldat->clk);clk_put (pldat->clk);free_netdev (ndev); - -return 0 ; }#ifdef CONFIG_PM
@@ -1505,7 +1503,7 @@ MODULE_DEVICE_TABLE(of, lpc_eth_match);static struct platform_driver lpc_eth_driver = { .probe = lpc_eth_drv_probe, - .remove = lpc_eth_drv_remove, + .remove_new = lpc_eth_drv_remove, #ifdef CONFIG_PM .suspend = lpc_eth_drv_suspend, .resume = lpc_eth_drv_resume,
Signature · 1 line
2.40.1
PATCH 40/54 net: ethernet: qualcomm: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/qualcomm/emac/emac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/qualcomm/emac/emac.c +2 -4
@@ -718,7 +718,7 @@ static int emac_probe(struct platform_device *pdev)return ret; } -static int emac_remove (struct platform_device *pdev) +static void emac_remove (struct platform_device *pdev) {struct net_device *netdev =dev_get_drvdata (&pdev->dev);struct emac_adapter *adpt =netdev_priv (netdev);
@@ -742,8 +742,6 @@ static int emac_remove(struct platform_device *pdev)iounmap (adpt->phy.base);free_netdev (netdev); - -return 0 ; }static void emac_shutdown (struct platform_device *pdev)
@@ -762,7 +760,7 @@ static void emac_shutdown(struct platform_device *pdev)static struct platform_driver emac_platform_driver = { .probe = emac_probe, - .remove = emac_remove, + .remove_new = emac_remove, .driver = { .name ="qcom-emac" , .of_match_table = emac_dt_match,
Signature · 1 line
2.40.1
Re: [PATCH net-next 40/54] net: ethernet: qualcomm: Convert to platform remove callback returning void
Quoted 4 lines · Uwe Kleine-König
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
PATCH 41/54 net: ethernet: renesas: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/renesas/ravb_main.c | 6 ++---- drivers/net/ethernet/renesas/rswitch.c | 6 ++---- drivers/net/ethernet/renesas/sh_eth.c | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-)
drivers/net/ethernet/renesas/ravb_main.c +2 -4
@@ -2878,7 +2878,7 @@ static int ravb_probe(struct platform_device *pdev)return error; } -static int ravb_remove (struct platform_device *pdev) +static void ravb_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct ravb_private *priv =netdev_priv (ndev);
@@ -2905,8 +2905,6 @@ static int ravb_remove(struct platform_device *pdev)reset_control_assert (priv->rstc);free_netdev (ndev);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static int ravb_wol_setup (struct net_device *ndev)
@@ -3044,7 +3042,7 @@ static const struct dev_pm_ops ravb_dev_pm_ops = {static struct platform_driver ravb_driver = { .probe = ravb_probe, - .remove = ravb_remove, + .remove_new = ravb_remove, .driver = { .name ="ravb" , .pm = &ravb_dev_pm_ops,
drivers/net/ethernet/renesas/rswitch.c +2 -4
@@ -1968,7 +1968,7 @@ static void rswitch_deinit(struct rswitch_private *priv)rswitch_clock_disable (priv); } -static int renesas_eth_sw_remove (struct platform_device *pdev) +static void renesas_eth_sw_remove (struct platform_device *pdev) {struct rswitch_private *priv =platform_get_drvdata (pdev);
@@ -1978,13 +1978,11 @@ static int renesas_eth_sw_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static struct platform_driver renesas_eth_sw_driver_platform = { .probe = renesas_eth_sw_probe, - .remove = renesas_eth_sw_remove, + .remove_new = renesas_eth_sw_remove, .driver = { .name ="renesas_eth_sw" , .of_match_table = renesas_eth_sw_of_table,
drivers/net/ethernet/renesas/sh_eth.c +2 -4
@@ -3431,7 +3431,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)return ret; } -static int sh_eth_drv_remove (struct platform_device *pdev) +static void sh_eth_drv_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct sh_eth_private *mdp =netdev_priv (ndev);
@@ -3441,8 +3441,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)sh_mdio_release (mdp);pm_runtime_disable (&pdev->dev);free_netdev (ndev); - -return 0 ; }#ifdef CONFIG_PM
@@ -3562,7 +3560,7 @@ MODULE_DEVICE_TABLE(platform, sh_eth_id_table);static struct platform_driver sh_eth_driver = { .probe = sh_eth_drv_probe, - .remove = sh_eth_drv_remove, + .remove_new = sh_eth_drv_remove, .id_table = sh_eth_id_table, .driver = { .name =CARDNAME ,
Signature · 1 line
2.40.1
Re: [PATCH net-next 41/54] net: ethernet: renesas: Convert to platform remove callback returning void
Quoted 9 lines · Uwe Kleine-König
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().
Quoted 4 lines
Trivially convert these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH net-next 41/54] net: ethernet: renesas: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigHello!
Quoted 13 lines · Uwe Kleine-König
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 these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
[...]
drivers/net/ethernet/renesas/rswitch.c
Quoted 4 lines
drivers/net/ethernet/renesas/rswitch.c +0
-0
Hm, I still need to do a patch clarifying that I don't do rswitch reviews --
I'm not familiar with that hardware and don't have the manuals ATM...
[...]
[...]
MBR, Sergey
RE: [PATCH net-next 41/54] net: ethernet: renesas: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigHi Uwe,
Quoted 11 lines
From: Uwe Kleine-König, Sent: Tuesday, September 19, 2023 5:42 AM
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().
Quoted 4 lines
Trivially convert these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Thank you for the patch!
Best regards,
Yoshihiro Shimoda
Quoted 98 lines
--- drivers/net/ethernet/renesas/ravb_main.c | 6 ++---- drivers/net/ethernet/renesas/rswitch.c | 6 ++---- drivers/net/ethernet/renesas/sh_eth.c | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-)drivers/net/ethernet/renesas/ravb_main.c +2
-4@@ -2878,7 +2878,7 @@ static int ravb_probe(struct platform_device *pdev)return error; } -static int ravb_remove (struct platform_device *pdev) +static void ravb_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct ravb_private *priv =netdev_priv (ndev);@@ -2905,8 +2905,6 @@ static int ravb_remove(struct platform_device *pdev)reset_control_assert (priv->rstc);free_netdev (ndev);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static int ravb_wol_setup (struct net_device *ndev)@@ -3044,7 +3042,7 @@ static const struct dev_pm_ops ravb_dev_pm_ops = {static struct platform_driver ravb_driver = { .probe = ravb_probe, - .remove = ravb_remove, + .remove_new = ravb_remove, .driver = { .name ="ravb" , .pm = &ravb_dev_pm_ops,drivers/net/ethernet/renesas/rswitch.c +2
-4@@ -1968,7 +1968,7 @@ static void rswitch_deinit(struct rswitch_private *priv)rswitch_clock_disable (priv); } -static int renesas_eth_sw_remove (struct platform_device *pdev) +static void renesas_eth_sw_remove (struct platform_device *pdev) {struct rswitch_private *priv =platform_get_drvdata (pdev);@@ -1978,13 +1978,11 @@ static int renesas_eth_sw_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static struct platform_driver renesas_eth_sw_driver_platform = { .probe = renesas_eth_sw_probe, - .remove = renesas_eth_sw_remove, + .remove_new = renesas_eth_sw_remove, .driver = { .name ="renesas_eth_sw" , .of_match_table = renesas_eth_sw_of_table,drivers/net/ethernet/renesas/sh_eth.c +2
-5@@ -3431,7 +3431,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)return ret; } -static int sh_eth_drv_remove (struct platform_device *pdev) +static void sh_eth_drv_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct sh_eth_private *mdp =netdev_priv (ndev);@@ -3441,8 +3441,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)sh_mdio_release (mdp);pm_runtime_disable (&pdev->dev);free_netdev (ndev); - -return 0 ; }#ifdef CONFIG_PM @@ -3562,7 +3560,7 @@ MODULE_DEVICE_TABLE(platform, sh_eth_id_table);static struct platform_driver sh_eth_driver = { .probe = sh_eth_drv_probe, - .remove = sh_eth_drv_remove, + .remove_new = sh_eth_drv_remove, .id_table = sh_eth_id_table, .driver = { .name =CARDNAME , --2.40.1
PATCH 42/54 net: ethernet: samsung: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c +2 -4
@@ -169,13 +169,11 @@ static int sxgbe_platform_probe(struct platform_device *pdev)* Description: this function calls the main to free the net resources * and calls the platforms hook and release the resources (e.g. mem). */ -static int sxgbe_platform_remove (struct platform_device *pdev) +static void sxgbe_platform_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);sxgbe_drv_remove (ndev); - -return 0 ; }#ifdef CONFIG_PM
@@ -226,7 +224,7 @@ MODULE_DEVICE_TABLE(of, sxgbe_dt_ids);static struct platform_driver sxgbe_platform_driver = { .probe = sxgbe_platform_probe, - .remove = sxgbe_platform_remove, + .remove_new = sxgbe_platform_remove, .driver = { .name =SXGBE_RESOURCE_NAME , .pm = &sxgbe_platform_pm_ops,
Signature · 1 line
2.40.1
PATCH 43/54 net: ethernet: seeq: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/seeq/sgiseeq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/seeq/sgiseeq.c +2 -4
@@ -819,7 +819,7 @@ static int sgiseeq_probe(struct platform_device *pdev)return err; } -static int sgiseeq_remove (struct platform_device *pdev) +static void sgiseeq_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct sgiseeq_private *sp =netdev_priv (dev);
@@ -828,13 +828,11 @@ static int sgiseeq_remove(struct platform_device *pdev)dma_free_noncoherent (&pdev->dev,sizeof (*sp->srings), sp->srings, sp->srings_dma,DMA_BIDIRECTIONAL );free_netdev (dev); - -return 0 ; }static struct platform_driver sgiseeq_driver = { .probe = sgiseeq_probe, - .remove = sgiseeq_remove, + .remove_new = sgiseeq_remove, .driver = { .name ="sgiseeq" , }
Signature · 1 line
2.40.1
PATCH 44/54 net: ethernet: sgi: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/sgi/ioc3-eth.c | 6 ++---- drivers/net/ethernet/sgi/meth.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/sgi/ioc3-eth.c +2 -4
@@ -962,7 +962,7 @@ static int ioc3eth_probe(struct platform_device *pdev)return err; } -static int ioc3eth_remove (struct platform_device *pdev) +static void ioc3eth_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct ioc3_private *ip =netdev_priv (dev);
@@ -973,8 +973,6 @@ static int ioc3eth_remove(struct platform_device *pdev)unregister_netdev (dev);del_timer_sync (&ip->ioc3_timer);free_netdev (dev); - -return 0 ; }
@@ -1275,7 +1273,7 @@ static void ioc3_set_multicast_list(struct net_device *dev)static struct platform_driver ioc3eth_driver = { .probe = ioc3eth_probe, - .remove = ioc3eth_remove, + .remove_new = ioc3eth_remove, .driver = { .name ="ioc3-eth" , }
drivers/net/ethernet/sgi/meth.c +2 -4
@@ -854,19 +854,17 @@ static int meth_probe(struct platform_device *pdev)return 0 ; } -static int meth_remove (struct platform_device *pdev) +static void meth_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);unregister_netdev (dev);free_netdev (dev); - -return 0 ; }static struct platform_driver meth_driver = { .probe = meth_probe, - .remove = meth_remove, + .remove_new = meth_remove, .driver = { .name ="meth" , }
Signature · 1 line
2.40.1
PATCH 45/54 net: ethernet: smsc: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/smsc/smc91x.c | 6 ++---- drivers/net/ethernet/smsc/smsc911x.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/smsc/smc91x.c +2 -4
@@ -2411,7 +2411,7 @@ static int smc_drv_probe(struct platform_device *pdev)return ret; } -static int smc_drv_remove (struct platform_device *pdev) +static void smc_drv_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct smc_local *lp =netdev_priv (ndev);
@@ -2436,8 +2436,6 @@ static int smc_drv_remove(struct platform_device *pdev)release_mem_region (res->start,SMC_IO_EXTENT );free_netdev (ndev); - -return 0 ; }static int smc_drv_suspend (struct device *dev)
@@ -2480,7 +2478,7 @@ static const struct dev_pm_ops smc_drv_pm_ops = {static struct platform_driver smc_driver = { .probe = smc_drv_probe, - .remove = smc_drv_remove, + .remove_new = smc_drv_remove, .driver = { .name =CARDNAME , .pm = &smc_drv_pm_ops,
drivers/net/ethernet/smsc/smsc911x.c +2 -4
@@ -2314,7 +2314,7 @@ static int smsc911x_init(struct net_device *dev)return 0 ; } -static int smsc911x_drv_remove (struct platform_device *pdev) +static void smsc911x_drv_remove (struct platform_device *pdev) {struct net_device *dev;struct smsc911x_data *pdata;
@@ -2348,8 +2348,6 @@ static int smsc911x_drv_remove(struct platform_device *pdev)free_netdev (dev);pm_runtime_disable (&pdev->dev); - -return 0 ; }/* standard register acces */
@@ -2668,7 +2666,7 @@ MODULE_DEVICE_TABLE(acpi, smsc911x_acpi_match);static struct platform_driver smsc911x_driver = { .probe = smsc911x_drv_probe, - .remove = smsc911x_drv_remove, + .remove_new = smsc911x_drv_remove, .driver = { .name =SMSC_CHIPNAME , .pm =SMSC911X_PM_OPS ,
Signature · 1 line
2.40.1
PATCH 46/54 net: ethernet: socionext: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/socionext/netsec.c | 6 ++---- drivers/net/ethernet/socionext/sni_ave.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/socionext/netsec.c +2 -4
@@ -2150,7 +2150,7 @@ static int netsec_probe(struct platform_device *pdev)return ret; } -static int netsec_remove (struct platform_device *pdev) +static void netsec_remove (struct platform_device *pdev) {struct netsec_priv *priv =platform_get_drvdata (pdev);
@@ -2162,8 +2162,6 @@ static int netsec_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);free_netdev (priv->ndev); - -return 0 ; }#ifdef CONFIG_PM
@@ -2211,7 +2209,7 @@ MODULE_DEVICE_TABLE(acpi, netsec_acpi_ids);static struct platform_driver netsec_driver = { .probe = netsec_probe, - .remove = netsec_remove, + .remove_new = netsec_remove, .driver = { .name ="netsec" , .pm = &netsec_pm_ops,
drivers/net/ethernet/socionext/sni_ave.c +2 -4
@@ -1719,7 +1719,7 @@ static int ave_probe(struct platform_device *pdev)return ret; } -static int ave_remove (struct platform_device *pdev) +static void ave_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct ave_private *priv =netdev_priv (ndev);
@@ -1727,8 +1727,6 @@ static int ave_remove(struct platform_device *pdev)unregister_netdev (ndev);netif_napi_del (&priv->napi_rx);netif_napi_del (&priv->napi_tx); - -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -1976,7 +1974,7 @@ MODULE_DEVICE_TABLE(of, of_ave_match);static struct platform_driver ave_driver = { .probe = ave_probe, - .remove = ave_remove, + .remove_new = ave_remove, .driver = { .name ="ave" , .pm =AVE_PM_OPS ,
Signature · 1 line
2.40.1
PATCH 47/54 net: ethernet: sun: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/sun/niu.c | 5 ++--- drivers/net/ethernet/sun/sunbmac.c | 6 ++---- drivers/net/ethernet/sun/sunqe.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-)
drivers/net/ethernet/sun/niu.c +2 -3
@@ -10132,7 +10132,7 @@ static int niu_of_probe(struct platform_device *op)return err; } -static int niu_of_remove (struct platform_device *op) +static void niu_of_remove (struct platform_device *op) {struct net_device *dev =platform_get_drvdata (op);
@@ -10165,7 +10165,6 @@ static int niu_of_remove(struct platform_device *op)free_netdev (dev); } -return 0 ; }static const struct of_device_id niu_match[] = {
@@ -10183,7 +10182,7 @@ static struct platform_driver niu_of_driver = { .of_match_table = niu_match, }, .probe = niu_of_probe, - .remove = niu_of_remove, + .remove_new = niu_of_remove, };#endif /* CONFIG_SPARC64 */
drivers/net/ethernet/sun/sunbmac.c +2 -4
@@ -1234,7 +1234,7 @@ static int bigmac_sbus_probe(struct platform_device *op)return bigmac_ether_init (op, qec_op); } -static int bigmac_sbus_remove (struct platform_device *op) +static void bigmac_sbus_remove (struct platform_device *op) {struct bigmac *bp =platform_get_drvdata (op);struct device *parent = op->dev.parent;
@@ -1255,8 +1255,6 @@ static int bigmac_sbus_remove(struct platform_device *op) bp->bblock_dvma);free_netdev (net_dev); - -return 0 ; }static const struct of_device_id bigmac_sbus_match[] = {
@@ -1274,7 +1272,7 @@ static struct platform_driver bigmac_sbus_driver = { .of_match_table = bigmac_sbus_match, }, .probe = bigmac_sbus_probe, - .remove = bigmac_sbus_remove, + .remove_new = bigmac_sbus_remove, };module_platform_driver (bigmac_sbus_driver);
drivers/net/ethernet/sun/sunqe.c +2 -4
@@ -933,7 +933,7 @@ static int qec_sbus_probe(struct platform_device *op)return qec_ether_init (op); } -static int qec_sbus_remove (struct platform_device *op) +static void qec_sbus_remove (struct platform_device *op) {struct sunqe *qp =platform_get_drvdata (op);struct net_device *net_dev = qp->dev;
@@ -948,8 +948,6 @@ static int qec_sbus_remove(struct platform_device *op) qp->buffers, qp->buffers_dvma);free_netdev (net_dev); - -return 0 ; }static const struct of_device_id qec_sbus_match[] = {
@@ -967,7 +965,7 @@ static struct platform_driver qec_sbus_driver = { .of_match_table = qec_sbus_match, }, .probe = qec_sbus_probe, - .remove = qec_sbus_remove, + .remove_new = qec_sbus_remove, };static int __init qec_init (void )
Signature · 1 line
2.40.1
PATCH 48/54 net: ethernet: sunplus: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/sunplus/spl2sw_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/sunplus/spl2sw_driver.c +2 -4
@@ -511,7 +511,7 @@ static int spl2sw_probe(struct platform_device *pdev)return ret; } -static int spl2sw_remove (struct platform_device *pdev) +static void spl2sw_remove (struct platform_device *pdev) {struct spl2sw_common *comm;int i;
@@ -538,8 +538,6 @@ static int spl2sw_remove(struct platform_device *pdev)spl2sw_mdio_remove (comm);clk_disable_unprepare (comm->clk); - -return 0 ; }static const struct of_device_id spl2sw_of_match[] = {
@@ -551,7 +549,7 @@ MODULE_DEVICE_TABLE(of, spl2sw_of_match);static struct platform_driver spl2sw_driver = { .probe = spl2sw_probe, - .remove = spl2sw_remove, + .remove_new = spl2sw_remove, .driver = { .name ="sp7021_emac" , .of_match_table = spl2sw_of_match,
Signature · 1 line
2.40.1
PATCH 49/54 net: ethernet: ti: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/ti/cpmac.c | 6 ++---- drivers/net/ethernet/ti/davinci_emac.c | 6 ++---- drivers/net/ethernet/ti/davinci_mdio.c | 6 ++---- drivers/net/ethernet/ti/netcp_core.c | 5 ++--- 4 files changed, 8 insertions(+), 15 deletions(-)
drivers/net/ethernet/ti/cpmac.c +2 -4
@@ -1151,14 +1151,12 @@ static int cpmac_probe(struct platform_device *pdev)return rc; } -static int cpmac_remove (struct platform_device *pdev) +static void cpmac_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);unregister_netdev (dev);free_netdev (dev); - -return 0 ; }static struct platform_driver cpmac_driver = {
@@ -1166,7 +1164,7 @@ static struct platform_driver cpmac_driver = { .name = "cpmac", }, .probe = cpmac_probe, - .remove = cpmac_remove, + .remove_new = cpmac_remove, };int __init cpmac_init (void )
drivers/net/ethernet/ti/davinci_emac.c +2 -4
@@ -2002,7 +2002,7 @@ static int davinci_emac_probe(struct platform_device *pdev)* Called when removing the device driver. We disable clock usage and release * the resources taken up by the driver and unregister network device */ -static int davinci_emac_remove (struct platform_device *pdev) +static void davinci_emac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct emac_priv *priv =netdev_priv (ndev);
@@ -2022,8 +2022,6 @@ static int davinci_emac_remove(struct platform_device *pdev)if (of_phy_is_fixed_link (np))of_phy_deregister_fixed_link (np);free_netdev (ndev); - -return 0 ; }static int davinci_emac_suspend (struct device *dev)
@@ -2076,7 +2074,7 @@ static struct platform_driver davinci_emac_driver = { .of_match_table = davinci_emac_of_match, }, .probe = davinci_emac_probe, - .remove = davinci_emac_remove, + .remove_new = davinci_emac_remove, };/**
drivers/net/ethernet/ti/davinci_mdio.c +2 -4
@@ -673,7 +673,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)return ret; } -static int davinci_mdio_remove (struct platform_device *pdev) +static void davinci_mdio_remove (struct platform_device *pdev) {struct davinci_mdio_data *data =platform_get_drvdata (pdev);
@@ -686,8 +686,6 @@ static int davinci_mdio_remove(struct platform_device *pdev)pm_runtime_dont_use_autosuspend (&pdev->dev);pm_runtime_disable (&pdev->dev); - -return 0 ; }#ifdef CONFIG_PM
@@ -766,7 +764,7 @@ static struct platform_driver davinci_mdio_driver = { .of_match_table = of_match_ptr(davinci_mdio_of_mtable), }, .probe = davinci_mdio_probe, - .remove = davinci_mdio_remove, + .remove_new = davinci_mdio_remove, };static int __init davinci_mdio_init (void )
drivers/net/ethernet/ti/netcp_core.c +2 -3
@@ -2228,7 +2228,7 @@ static int netcp_probe(struct platform_device *pdev)return ret; } -static int netcp_remove (struct platform_device *pdev) +static void netcp_remove (struct platform_device *pdev) {struct netcp_device *netcp_device =platform_get_drvdata (pdev);struct netcp_intf *netcp_intf, *netcp_tmp;
@@ -2256,7 +2256,6 @@ static int netcp_remove(struct platform_device *pdev)pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev);platform_set_drvdata (pdev,NULL ); -return 0 ; }static const struct of_device_id of_match[] = {
@@ -2271,7 +2270,7 @@ static struct platform_driver netcp_driver = { .of_match_table = of_match, }, .probe = netcp_probe, - .remove = netcp_remove, + .remove_new = netcp_remove, };module_platform_driver (netcp_driver);
Signature · 1 line
2.40.1
Re: [PATCH net-next 49/54] net: ethernet: ti: Convert to platform remove callback returning void
Quoted 9 lines · Uwe Kleine-König
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().
Quoted 6 lines
Trivially convert these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>--- drivers/net/ethernet/ti/cpmac.c | 6 ++----
Signature · 1 line
Florian
PATCH 50/54 net: ethernet: tundra: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/tundra/tsi108_eth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/tundra/tsi108_eth.c +2 -4
@@ -1660,7 +1660,7 @@ static void tsi108_timed_checker(struct timer_list *t)mod_timer (&data->timer, jiffies +CHECK_PHY_INTERVAL ); } -static int tsi108_ether_remove (struct platform_device *pdev) +static void tsi108_ether_remove (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct tsi108_prv_data *priv =netdev_priv (dev);
@@ -1670,15 +1670,13 @@ static int tsi108_ether_remove(struct platform_device *pdev)iounmap (priv->regs);iounmap (priv->phyregs);free_netdev (dev); - -return 0 ; }/* Structure for a device driver */ static struct platform_driver tsi_eth_driver = { .probe = tsi108_init_one, - .remove = tsi108_ether_remove, + .remove_new = tsi108_ether_remove, .driver = { .name ="tsi-ethernet" , },
Signature · 1 line
2.40.1
PATCH 51/54 net: ethernet: via: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/via/via-rhine.c | 6 ++---- drivers/net/ethernet/via/via-velocity.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/via/via-rhine.c +2 -4
@@ -2443,7 +2443,7 @@ static void rhine_remove_one_pci(struct pci_dev *pdev)pci_disable_device (pdev); } -static int rhine_remove_one_platform (struct platform_device *pdev) +static void rhine_remove_one_platform (struct platform_device *pdev) {struct net_device *dev =platform_get_drvdata (pdev);struct rhine_private *rp =netdev_priv (dev);
@@ -2453,8 +2453,6 @@ static int rhine_remove_one_platform(struct platform_device *pdev)iounmap (rp->base);free_netdev (dev); - -return 0 ; }static void rhine_shutdown_pci (struct pci_dev *pdev)
@@ -2572,7 +2570,7 @@ static struct pci_driver rhine_driver_pci = {static struct platform_driver rhine_driver_platform = { .probe = rhine_init_one_platform, - .remove = rhine_remove_one_platform, + .remove_new = rhine_remove_one_platform, .driver = { .name =DRV_NAME , .of_match_table = rhine_of_tbl,
drivers/net/ethernet/via/via-velocity.c +2 -4
@@ -2957,11 +2957,9 @@ static int velocity_platform_probe(struct platform_device *pdev)return velocity_probe (&pdev->dev, irq, info,BUS_PLATFORM ); } -static int velocity_platform_remove (struct platform_device *pdev) +static void velocity_platform_remove (struct platform_device *pdev) {velocity_remove (&pdev->dev); - -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -3249,7 +3247,7 @@ static struct pci_driver velocity_pci_driver = {static struct platform_driver velocity_platform_driver = { .probe = velocity_platform_probe, - .remove = velocity_platform_remove, + .remove_new = velocity_platform_remove, .driver = { .name ="via-velocity" , .of_match_table = velocity_of_ids,
Signature · 1 line
2.40.1
PATCH 52/54 net: ethernet: wiznet: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/wiznet/w5100.c | 6 ++---- drivers/net/ethernet/wiznet/w5300.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/net/ethernet/wiznet/w5100.c +2 -4
@@ -1062,11 +1062,9 @@ static int w5100_mmio_probe(struct platform_device *pdev) mac_addr, irq, data ? data->link_gpio : -EINVAL); } -static int w5100_mmio_remove (struct platform_device *pdev) +static void w5100_mmio_remove (struct platform_device *pdev) {w5100_remove (&pdev->dev); - -return 0 ; }void *w5100_ops_priv (const struct net_device *ndev)
@@ -1273,6 +1271,6 @@ static struct platform_driver w5100_mmio_driver = { .pm = &w5100_pm_ops, }, .probe = w5100_mmio_probe, - .remove = w5100_mmio_remove, + .remove_new = w5100_mmio_remove, };module_platform_driver (w5100_mmio_driver);
drivers/net/ethernet/wiznet/w5300.c +2 -3
@@ -627,7 +627,7 @@ static int w5300_probe(struct platform_device *pdev)return err; } -static int w5300_remove (struct platform_device *pdev) +static void w5300_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct w5300_priv *priv =netdev_priv (ndev);
@@ -639,7 +639,6 @@ static int w5300_remove(struct platform_device *pdev)unregister_netdev (ndev);free_netdev (ndev); -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -683,7 +682,7 @@ static struct platform_driver w5300_driver = { .pm = &w5300_pm_ops, }, .probe = w5300_probe, - .remove = w5300_remove, + .remove_new = w5300_remove, };module_platform_driver (w5300_driver);
Signature · 1 line
2.40.1
PATCH 53/54 net: ethernet: xilinx: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
--- drivers/net/ethernet/xilinx/ll_temac_main.c | 5 ++--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 ++---- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +2 -3
@@ -1626,7 +1626,7 @@ static int temac_probe(struct platform_device *pdev)return rc; } -static int temac_remove (struct platform_device *pdev) +static void temac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct temac_local *lp =netdev_priv (ndev);
@@ -1636,7 +1636,6 @@ static int temac_remove(struct platform_device *pdev)if (lp->phy_node)of_node_put (lp->phy_node);temac_mdio_teardown (lp); -return 0 ; }static const struct of_device_id temac_of_match[] = {
@@ -1650,7 +1649,7 @@ MODULE_DEVICE_TABLE(of, temac_of_match);static struct platform_driver temac_driver = { .probe = temac_probe, - .remove = temac_remove, + .remove_new = temac_remove, .driver = { .name ="xilinx_temac" , .of_match_table = temac_of_match,
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +2 -4
@@ -2183,7 +2183,7 @@ static int axienet_probe(struct platform_device *pdev)return ret; } -static int axienet_remove (struct platform_device *pdev) +static void axienet_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);struct axienet_local *lp =netdev_priv (ndev);
@@ -2202,8 +2202,6 @@ static int axienet_remove(struct platform_device *pdev)clk_disable_unprepare (lp->axi_clk);free_netdev (ndev); - -return 0 ; }static void axienet_shutdown (struct platform_device *pdev)
@@ -2256,7 +2254,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops,static struct platform_driver axienet_driver = { .probe = axienet_probe, - .remove = axienet_remove, + .remove_new = axienet_remove, .shutdown = axienet_shutdown, .driver = { .name ="xilinx_axienet" ,
drivers/net/ethernet/xilinx/xilinx_emaclite.c +2 -4
@@ -1183,7 +1183,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)* * Return: 0, always. */ -static int xemaclite_of_remove (struct platform_device *of_dev) +static void xemaclite_of_remove (struct platform_device *of_dev) {struct net_device *ndev =platform_get_drvdata (of_dev);
@@ -1202,8 +1202,6 @@ static int xemaclite_of_remove(struct platform_device *of_dev) lp->phy_node =NULL ;free_netdev (ndev); - -return 0 ; }#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -1262,7 +1260,7 @@ static struct platform_driver xemaclite_of_driver = { .of_match_table = xemaclite_of_match, }, .probe = xemaclite_of_probe, - .remove = xemaclite_of_remove, + .remove_new = xemaclite_of_remove, };module_platform_driver (xemaclite_of_driver);
Signature · 1 line
2.40.1
Pandey, Radhey Shyam
maintainerRE: [PATCH net-next 53/54] net: ethernet: xilinx: Convert to platform remove callback returning void
Quoted 112 lines
-----Original Message-----
From: Uwe Kleine-König <[email protected]>
Sent: Tuesday, September 19, 2023 2:12 AM
To: David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>
Cc: Simek, Michal <[email protected]>; Pandey, Radhey Shyam <[email protected]>; Katakam, Harini <[email protected]>; Haoyue Xu <[email protected]>; huangjunxian <[email protected]>; Rob Herring <[email protected]>; Yang Yingliang <[email protected]>; Dan Carpenter <[email protected]>; Bhupesh Sharma <[email protected]>; Simon Horman <[email protected]>; Alex Elder <[email protected]>; Wei Fang <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [PATCH net-next 53/54] net: ethernet: xilinx: Convert to platform remove callback returning voidThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>--- drivers/net/ethernet/xilinx/ll_temac_main.c | 5 ++--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 ++---- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-)drivers/net/ethernet/xilinx/ll_temac_main.c +1
-1@@ -1626,7 +1626,7 @@ static int temac_probe(struct platform_device *pdev)return rc; } -static int temac_remove (struct platform_device *pdev) +static void temac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);drivers/net/ethernet/xilinx/ll_temac_main.c +0
-1struct temac_local *lp =netdev_priv (ndev);@@ -1636,7 +1636,6 @@ static int temac_remove(struct platform_device *pdev)if (lp->phy_node)of_node_put (lp->phy_node);temac_mdio_teardown (lp); -return 0 ; }static const struct
of_device_idtemac_of_match[] = {drivers/net/ethernet/xilinx/ll_temac_main.c +1
-1@@ -1650,7 +1649,7 @@ MODULE_DEVICE_TABLE(of, temac_of_match);static struct platform_driver temac_driver = { .probe = temac_probe, - .remove = temac_remove, + .remove_new = temac_remove, .driver = { .name ="xilinx_temac" , .of_match_table = temac_of_match,drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1
-1@@ -2183,7 +2183,7 @@ static int axienet_probe(struct platform_device *pdev)return ret; } -static int axienet_remove (struct platform_device *pdev) +static void axienet_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0
-2struct axienet_local *lp =netdev_priv (ndev);@@ -2202,8 +2202,6 @@ static int axienet_remove(struct platform_device *pdev)clk_disable_unprepare (lp->axi_clk);free_netdev (ndev); - -return 0 ; }static void
axienet_shutdown(struct platform_device *pdev)drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1
-1@@ -2256,7 +2254,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops, static struct platform_driver axienet_driver = { .probe = axienet_probe, - .remove = axienet_remove, + .remove_new = axienet_remove, .shutdown = axienet_shutdown, .driver = {drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0
-0.name = "xilinx_axienet",drivers/net/ethernet/xilinx/xilinx_emaclite.c +0
-0
drivers/net/ethernet/xilinx/xilinx_emaclite.c static int xemaclite_of_probe(struct · line 1186
Quoted 4 lines
drivers/net/ethernet/xilinx/xilinx_emaclite.c +0
-0@@ -1183,7 +1183,7 @@ static int xemaclite_of_probe(structplatform_device *ofdev) * * Return: 0, always. */
Nit - kernel-doc return documentation needs to be updated.
Quoted 27 lines
drivers/net/ethernet/xilinx/xilinx_emaclite.c +1
-3-static int xemaclite_of_remove (struct platform_device *of_dev) +static void xemaclite_of_remove (struct platform_device *of_dev) {struct net_device *ndev =platform_get_drvdata (of_dev);@@ -1202,8 +1202,6 @@ static int xemaclite_of_remove(struct platform_device *of_dev) lp->phy_node = NULL;free_netdev (ndev); - -return 0 ; }#ifdef
CONFIG_NET_POLL_CONTROLLERdrivers/net/ethernet/xilinx/xilinx_emaclite.c +1
-1@@ -1262,7 +1260,7 @@ static struct platform_driver xemaclite_of_driver = { .of_match_table = xemaclite_of_match, }, .probe = xemaclite_of_probe, - .remove = xemaclite_of_remove, + .remove_new = xemaclite_of_remove, };
module_platform_driver(xemaclite_of_driver);
--
2.40.1
Re: [PATCH net-next 53/54] net: ethernet: xilinx: Convert to platform remove callback returning void
Hello,
[dropped Bhupesh Sharma from the list of recipents, usage of their email address resulted in a bounce.]
Quoted 110 lines · Radhey Shyam
Quoted 110 lines
-----Original Message-----
From: Uwe Kleine-König <[email protected]>
Sent: Tuesday, September 19, 2023 2:12 AM
To: David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>
Cc: Simek, Michal <[email protected]>; Pandey, Radhey Shyam <[email protected]>; Katakam, Harini <[email protected]>; Haoyue Xu <[email protected]>; huangjunxian <[email protected]>; Rob Herring <[email protected]>; Yang Yingliang <[email protected]>; Dan Carpenter <[email protected]>; Bhupesh Sharma <[email protected]>; Simon Horman <[email protected]>; Alex Elder <[email protected]>; Wei Fang <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [PATCH net-next 53/54] net: ethernet: xilinx: Convert to platform remove callback returning voidThe .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 these drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>--- drivers/net/ethernet/xilinx/ll_temac_main.c | 5 ++--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 ++---- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-)drivers/net/ethernet/xilinx/ll_temac_main.c +1
-1@@ -1626,7 +1626,7 @@ static int temac_probe(struct platform_device *pdev)return rc; } -static int temac_remove (struct platform_device *pdev) +static void temac_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);drivers/net/ethernet/xilinx/ll_temac_main.c +0
-1struct temac_local *lp =netdev_priv (ndev);@@ -1636,7 +1636,6 @@ static int temac_remove(struct platform_device *pdev)if (lp->phy_node)of_node_put (lp->phy_node);temac_mdio_teardown (lp); -return 0 ; }static const struct
of_device_idtemac_of_match[] = {drivers/net/ethernet/xilinx/ll_temac_main.c +1
-1@@ -1650,7 +1649,7 @@ MODULE_DEVICE_TABLE(of, temac_of_match);static struct platform_driver temac_driver = { .probe = temac_probe, - .remove = temac_remove, + .remove_new = temac_remove, .driver = { .name ="xilinx_temac" , .of_match_table = temac_of_match,drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1
-1@@ -2183,7 +2183,7 @@ static int axienet_probe(struct platform_device *pdev)return ret; } -static int axienet_remove (struct platform_device *pdev) +static void axienet_remove (struct platform_device *pdev) {struct net_device *ndev =platform_get_drvdata (pdev);drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0
-2struct axienet_local *lp =netdev_priv (ndev);@@ -2202,8 +2202,6 @@ static int axienet_remove(struct platform_device *pdev)clk_disable_unprepare (lp->axi_clk);free_netdev (ndev); - -return 0 ; }static void
axienet_shutdown(struct platform_device *pdev)drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1
-1@@ -2256,7 +2254,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops, static struct platform_driver axienet_driver = { .probe = axienet_probe, - .remove = axienet_remove, + .remove_new = axienet_remove, .shutdown = axienet_shutdown, .driver = {drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0
-0.name = "xilinx_axienet",drivers/net/ethernet/xilinx/xilinx_emaclite.c +0
-1--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
Quoted 8 lines
drivers/net/ethernet/xilinx/xilinx_emaclite.c static int xemaclite_of_probe(struct · line 1186
Quoted 6 lines
+++
b/drivers/net/ethernet/xilinx/xilinx_emaclite.cdrivers/net/ethernet/xilinx/xilinx_emaclite.c +0
-0@@ -1183,7 +1183,7 @@ static int xemaclite_of_probe(structplatform_device *ofdev) * * Return: 0, always. */ Nit - kernel-doc return documentation needs to be updated.
Indeed, I fixed that in my tree and so it will be addressed if and when I resend this patch.
Thanks
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
PATCH 54/54 net: ethernet: xscale: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/xscale/ixp4xx_eth.c +2 -3
@@ -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);
Signature · 1 line
2.40.1
Re: [PATCH net-next 54/54] net: ethernet: xscale: Convert to platform remove callback returning void
Hello Uwe, Linus,
Quoted 11 lines · Uwe Kleine-König
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.
Quoted 1 line
Signed-off-by Uwe Kleine-König <[email protected]>
Quoted 3 lines
--- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 5 lines
Krzysztof "Chris" Hałasa Sieć Badawcza Łukasiewicz Przemysłowy Instytut Automatyki i Pomiarów PIAP Al. Jerozolimskie 202, 02-486 Warszawa
Re: [PATCH net-next 54/54] net: ethernet: xscale: Convert to platform remove callback returning void
Quoted 2 lines · Krzysztof Hałasa
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.
Quoted 1 line
While I still have access to IXP425 and IXP435 hw,
Are they supported by the DTS files I created?
Quoted 5 lines
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 aMAINTAINERSpatch, 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
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 8 lines · On Mon, 18 Sep 2023 22:41:32 +0200 you wrote:
Hello,
this series convert nearly all platform drivers below
drivers/net/ethernetto useremove_new. The motivation is to get rid of an integer return code that is (mostly) ignored by the platform driver core and error prone on the driver side.[...]
Here is the summary with links:
- [net-next,01/54] net: ethernet: 8390: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/3c000faaaa65 - [net-next,02/54] net: ethernet: actions: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/d8c6b3fc918d - [net-next,03/54] net: ethernet: aeroflex: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/a0fbde8f647b - [net-next,04/54] net: ethernet: allwinner: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/9f07797c332e - [net-next,05/54] net: ethernet: altera: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/d0b0245b84c9 - [net-next,06/54] net: ethernet: amd: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/9ecae52f7db4 - [net-next,07/54] net: ethernet: apm: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/61471264c018 - [net-next,08/54] net: ethernet: apple: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/e5d0a380b2b4 - [net-next,09/54] net: ethernet: arc: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/de0afa130ed6 - [net-next,10/54] net: ethernet: atheros: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/c6e817838902 - [net-next,11/54] net: ethernet: broadcom: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/d4295df3e043 - [net-next,12/54] net: ethernet: cadence: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/6b5940402f9c - [net-next,13/54] net: ethernet: calxeda: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/ca76b17922e6 - [net-next,14/54] net: ethernet: cavium: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/de413f46a56e - [net-next,15/54] net: ethernet: cirrus: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/8ca0ae6a2ec7 - [net-next,16/54] net: ethernet: cortina: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/1f69574b5cba - [net-next,17/54] net: ethernet: davicom: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/ffb928290ba5 - [net-next,18/54] net: ethernet: dnet: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/5db6c1fed1f9 - [net-next,19/54] net: ethernet: engleder: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/d2e6c2ea996e - [net-next,20/54] net: ethernet: ethoc: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/4cc08098d197 - [net-next,21/54] net: ethernet: faraday: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/dc715af33b42 - [net-next,22/54] net: ethernet: hisilicon: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/e5835a0a5119 - [net-next,23/54] net: ethernet: i825xx: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/e5a6d397ca2e - [net-next,24/54] net: ethernet: ibm: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/ac35a3c4c8da - [net-next,25/54] net: ethernet: korina: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/551598a120d1 - [net-next,26/54] net: ethernet: lantiq_etop: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/e791aa06a2dd - [net-next,27/54] net: ethernet: lantiq_xrx200: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/adbb270655a1 - [net-next,28/54] net: ethernet: litex: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/36b80b8353af - [net-next,29/54] net: ethernet: marvell: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/fee02f498c9a - [net-next,30/54] net: ethernet: mediatek: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/5b6ce1734d9d - [net-next,31/54] net: ethernet: mellanox: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/e184700959ec - [net-next,32/54] net: ethernet: micrel: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/bae04ae2be07 - [net-next,33/54] net: ethernet: microchip: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/5253ae3a6223 - [net-next,34/54] net: ethernet: moxa:: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/253f9c47273d - [net-next,35/54] net: ethernet: mscc: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/0eaca7a9e9d6 - [net-next,36/54] net: ethernet: natsemi: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/9f0243d9bcc4 - [net-next,37/54] net: ethernet: natsemi: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/b83fb509c758 - [net-next,38/54] net: ethernet: ni: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/0f09f4e7d401 - [net-next,39/54] net: ethernet: nxp: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/241882d79f99 - [net-next,40/54] net: ethernet: qualcomm: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/5180236592b9 - [net-next,41/54] net: ethernet: renesas: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/0b4f04e2f60b - [net-next,42/54] net: ethernet: samsung: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/6e8b0ef7b389 - [net-next,43/54] net: ethernet: seeq: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/02c74030beff - [net-next,44/54] net: ethernet: sgi: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/506a327ceaaa - [net-next,45/54] net: ethernet: smsc: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/e8e2c863f941 - [net-next,46/54] net: ethernet: socionext: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/d3cd32451c7e - [net-next,47/54] net: ethernet: sun: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/8f4e45a0135e - [net-next,48/54] net: ethernet: sunplus: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/ede778ed3ea9 - [net-next,49/54] net: ethernet: ti: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/231ea972ccaf - [net-next,50/54] net: ethernet: tundra: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/2f961952e19e - [net-next,51/54] net: ethernet: via: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/70680f178280 - [net-next,52/54] net: ethernet: wiznet: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/46b5668494d0 - [net-next,53/54] net: ethernet: xilinx: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/2e0ec0afa902 - [net-next,54/54] net: ethernet: xscale: Convert to platform remove callback returning void https://git.kernel.org/netdev/net-next/c/d74a5c154b6f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html