Skip to content

Commit 6f0b985

Browse files
committed
Merge branch 'net-platform-remove-void'
Uwe Kleine-König says: ==================== net: ethernet: Convert to platform remove callback returning void 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 5c5a768 ("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. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 5bed8d5 + d74a5c1 commit 6f0b985

101 files changed

Lines changed: 213 additions & 399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/net/ethernet/8390/ax88796.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ static int ax_init_dev(struct net_device *dev)
811811
return ret;
812812
}
813813

814-
static int ax_remove(struct platform_device *pdev)
814+
static void ax_remove(struct platform_device *pdev)
815815
{
816816
struct net_device *dev = platform_get_drvdata(pdev);
817817
struct ei_device *ei_local = netdev_priv(dev);
@@ -832,8 +832,6 @@ static int ax_remove(struct platform_device *pdev)
832832

833833
platform_set_drvdata(pdev, NULL);
834834
free_netdev(dev);
835-
836-
return 0;
837835
}
838836

839837
/*
@@ -1011,7 +1009,7 @@ static struct platform_driver axdrv = {
10111009
.name = "ax88796",
10121010
},
10131011
.probe = ax_probe,
1014-
.remove = ax_remove,
1012+
.remove_new = ax_remove,
10151013
.suspend = ax_suspend,
10161014
.resume = ax_resume,
10171015
};

drivers/net/ethernet/8390/mcf8390.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int mcf8390_probe(struct platform_device *pdev)
441441
return 0;
442442
}
443443

444-
static int mcf8390_remove(struct platform_device *pdev)
444+
static void mcf8390_remove(struct platform_device *pdev)
445445
{
446446
struct net_device *dev = platform_get_drvdata(pdev);
447447
struct resource *mem;
@@ -450,15 +450,14 @@ static int mcf8390_remove(struct platform_device *pdev)
450450
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
451451
release_mem_region(mem->start, resource_size(mem));
452452
free_netdev(dev);
453-
return 0;
454453
}
455454

456455
static struct platform_driver mcf8390_drv = {
457456
.driver = {
458457
.name = "mcf8390",
459458
},
460459
.probe = mcf8390_probe,
461-
.remove = mcf8390_remove,
460+
.remove_new = mcf8390_remove,
462461
};
463462

464463
module_platform_driver(mcf8390_drv);

drivers/net/ethernet/8390/ne.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static int __init ne_drv_probe(struct platform_device *pdev)
823823
return 0;
824824
}
825825

826-
static int ne_drv_remove(struct platform_device *pdev)
826+
static void ne_drv_remove(struct platform_device *pdev)
827827
{
828828
struct net_device *dev = platform_get_drvdata(pdev);
829829

@@ -842,7 +842,6 @@ static int ne_drv_remove(struct platform_device *pdev)
842842
release_region(dev->base_addr, NE_IO_EXTENT);
843843
free_netdev(dev);
844844
}
845-
return 0;
846845
}
847846

848847
/* Remove unused devices or all if true. */
@@ -895,7 +894,7 @@ static int ne_drv_resume(struct platform_device *pdev)
895894
#endif
896895

897896
static struct platform_driver ne_driver = {
898-
.remove = ne_drv_remove,
897+
.remove_new = ne_drv_remove,
899898
.suspend = ne_drv_suspend,
900899
.resume = ne_drv_resume,
901900
.driver = {

drivers/net/ethernet/actions/owl-emac.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,15 +1582,13 @@ static int owl_emac_probe(struct platform_device *pdev)
15821582
return 0;
15831583
}
15841584

1585-
static int owl_emac_remove(struct platform_device *pdev)
1585+
static void owl_emac_remove(struct platform_device *pdev)
15861586
{
15871587
struct owl_emac_priv *priv = platform_get_drvdata(pdev);
15881588

15891589
netif_napi_del(&priv->napi);
15901590
phy_disconnect(priv->netdev->phydev);
15911591
cancel_work_sync(&priv->mac_reset_task);
1592-
1593-
return 0;
15941592
}
15951593

15961594
static const struct of_device_id owl_emac_of_match[] = {
@@ -1609,7 +1607,7 @@ static struct platform_driver owl_emac_driver = {
16091607
.pm = &owl_emac_pm_ops,
16101608
},
16111609
.probe = owl_emac_probe,
1612-
.remove = owl_emac_remove,
1610+
.remove_new = owl_emac_remove,
16131611
};
16141612
module_platform_driver(owl_emac_driver);
16151613

drivers/net/ethernet/aeroflex/greth.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ static int greth_of_probe(struct platform_device *ofdev)
15251525
return err;
15261526
}
15271527

1528-
static int greth_of_remove(struct platform_device *of_dev)
1528+
static void greth_of_remove(struct platform_device *of_dev)
15291529
{
15301530
struct net_device *ndev = platform_get_drvdata(of_dev);
15311531
struct greth_private *greth = netdev_priv(ndev);
@@ -1544,8 +1544,6 @@ static int greth_of_remove(struct platform_device *of_dev)
15441544
of_iounmap(&of_dev->resource[0], greth->regs, resource_size(&of_dev->resource[0]));
15451545

15461546
free_netdev(ndev);
1547-
1548-
return 0;
15491547
}
15501548

15511549
static const struct of_device_id greth_of_match[] = {
@@ -1566,7 +1564,7 @@ static struct platform_driver greth_of_driver = {
15661564
.of_match_table = greth_of_match,
15671565
},
15681566
.probe = greth_of_probe,
1569-
.remove = greth_of_remove,
1567+
.remove_new = greth_of_remove,
15701568
};
15711569

15721570
module_platform_driver(greth_of_driver);

drivers/net/ethernet/allwinner/sun4i-emac.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ static int emac_probe(struct platform_device *pdev)
10831083
return ret;
10841084
}
10851085

1086-
static int emac_remove(struct platform_device *pdev)
1086+
static void emac_remove(struct platform_device *pdev)
10871087
{
10881088
struct net_device *ndev = platform_get_drvdata(pdev);
10891089
struct emac_board_info *db = netdev_priv(ndev);
@@ -1101,7 +1101,6 @@ static int emac_remove(struct platform_device *pdev)
11011101
free_netdev(ndev);
11021102

11031103
dev_dbg(&pdev->dev, "released and freed device\n");
1104-
return 0;
11051104
}
11061105

11071106
static int emac_suspend(struct platform_device *dev, pm_message_t state)
@@ -1143,7 +1142,7 @@ static struct platform_driver emac_driver = {
11431142
.of_match_table = emac_of_match,
11441143
},
11451144
.probe = emac_probe,
1146-
.remove = emac_remove,
1145+
.remove_new = emac_remove,
11471146
.suspend = emac_suspend,
11481147
.resume = emac_resume,
11491148
};

drivers/net/ethernet/altera/altera_tse_main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ static int altera_tse_probe(struct platform_device *pdev)
14641464

14651465
/* Remove Altera TSE MAC device
14661466
*/
1467-
static int altera_tse_remove(struct platform_device *pdev)
1467+
static void altera_tse_remove(struct platform_device *pdev)
14681468
{
14691469
struct net_device *ndev = platform_get_drvdata(pdev);
14701470
struct altera_tse_private *priv = netdev_priv(ndev);
@@ -1476,8 +1476,6 @@ static int altera_tse_remove(struct platform_device *pdev)
14761476
lynx_pcs_destroy(priv->pcs);
14771477

14781478
free_netdev(ndev);
1479-
1480-
return 0;
14811479
}
14821480

14831481
static const struct altera_dmaops altera_dtype_sgdma = {
@@ -1528,7 +1526,7 @@ MODULE_DEVICE_TABLE(of, altera_tse_ids);
15281526

15291527
static struct platform_driver altera_tse_driver = {
15301528
.probe = altera_tse_probe,
1531-
.remove = altera_tse_remove,
1529+
.remove_new = altera_tse_remove,
15321530
.suspend = NULL,
15331531
.resume = NULL,
15341532
.driver = {

drivers/net/ethernet/amd/au1000_eth.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ static int au1000_probe(struct platform_device *pdev)
13231323
return err;
13241324
}
13251325

1326-
static int au1000_remove(struct platform_device *pdev)
1326+
static void au1000_remove(struct platform_device *pdev)
13271327
{
13281328
struct net_device *dev = platform_get_drvdata(pdev);
13291329
struct au1000_private *aup = netdev_priv(dev);
@@ -1359,13 +1359,11 @@ static int au1000_remove(struct platform_device *pdev)
13591359
release_mem_region(macen->start, resource_size(macen));
13601360

13611361
free_netdev(dev);
1362-
1363-
return 0;
13641362
}
13651363

13661364
static struct platform_driver au1000_eth_driver = {
13671365
.probe = au1000_probe,
1368-
.remove = au1000_remove,
1366+
.remove_new = au1000_remove,
13691367
.driver = {
13701368
.name = "au1000-eth",
13711369
},

drivers/net/ethernet/amd/sunlance.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ static int sunlance_sbus_probe(struct platform_device *op)
14871487
return err;
14881488
}
14891489

1490-
static int sunlance_sbus_remove(struct platform_device *op)
1490+
static void sunlance_sbus_remove(struct platform_device *op)
14911491
{
14921492
struct lance_private *lp = platform_get_drvdata(op);
14931493
struct net_device *net_dev = lp->dev;
@@ -1497,8 +1497,6 @@ static int sunlance_sbus_remove(struct platform_device *op)
14971497
lance_free_hwresources(lp);
14981498

14991499
free_netdev(net_dev);
1500-
1501-
return 0;
15021500
}
15031501

15041502
static const struct of_device_id sunlance_sbus_match[] = {
@@ -1516,7 +1514,7 @@ static struct platform_driver sunlance_sbus_driver = {
15161514
.of_match_table = sunlance_sbus_match,
15171515
},
15181516
.probe = sunlance_sbus_probe,
1519-
.remove = sunlance_sbus_remove,
1517+
.remove_new = sunlance_sbus_remove,
15201518
};
15211519

15221520
module_platform_driver(sunlance_sbus_driver);

drivers/net/ethernet/amd/xgbe/xgbe-platform.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
512512
return ret;
513513
}
514514

515-
static int xgbe_platform_remove(struct platform_device *pdev)
515+
static void xgbe_platform_remove(struct platform_device *pdev)
516516
{
517517
struct xgbe_prv_data *pdata = platform_get_drvdata(pdev);
518518

@@ -521,8 +521,6 @@ static int xgbe_platform_remove(struct platform_device *pdev)
521521
platform_device_put(pdata->phy_platdev);
522522

523523
xgbe_free_pdata(pdata);
524-
525-
return 0;
526524
}
527525

528526
#ifdef CONFIG_PM_SLEEP
@@ -615,7 +613,7 @@ static struct platform_driver xgbe_driver = {
615613
.pm = &xgbe_platform_pm_ops,
616614
},
617615
.probe = xgbe_platform_probe,
618-
.remove = xgbe_platform_remove,
616+
.remove_new = xgbe_platform_remove,
619617
};
620618

621619
int xgbe_platform_init(void)

0 commit comments

Comments
 (0)