Skip to content

Commit ad1e15d

Browse files
committed
Merge branch 'dsa-platform-remove-void'
Uwe Kleine-König says: ==================== net: dsa: Convert to platform remove callback returning void this series converts all platform drivers below drivers/net/dsa 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. 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 or a subject prefix is suboptimal, please apply the remainder of this series anyhow. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 6f0b985 + ce322d4 commit ad1e15d

11 files changed

Lines changed: 31 additions & 54 deletions

File tree

drivers/net/dsa/b53/b53_mmap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,12 @@ static int b53_mmap_probe(struct platform_device *pdev)
324324
return b53_switch_register(dev);
325325
}
326326

327-
static int b53_mmap_remove(struct platform_device *pdev)
327+
static void b53_mmap_remove(struct platform_device *pdev)
328328
{
329329
struct b53_device *dev = platform_get_drvdata(pdev);
330330

331331
if (dev)
332332
b53_switch_remove(dev);
333-
334-
return 0;
335333
}
336334

337335
static void b53_mmap_shutdown(struct platform_device *pdev)
@@ -372,7 +370,7 @@ MODULE_DEVICE_TABLE(of, b53_mmap_of_table);
372370

373371
static struct platform_driver b53_mmap_driver = {
374372
.probe = b53_mmap_probe,
375-
.remove = b53_mmap_remove,
373+
.remove_new = b53_mmap_remove,
376374
.shutdown = b53_mmap_shutdown,
377375
.driver = {
378376
.name = "b53-switch",

drivers/net/dsa/b53/b53_srab.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,17 +657,15 @@ static int b53_srab_probe(struct platform_device *pdev)
657657
return b53_switch_register(dev);
658658
}
659659

660-
static int b53_srab_remove(struct platform_device *pdev)
660+
static void b53_srab_remove(struct platform_device *pdev)
661661
{
662662
struct b53_device *dev = platform_get_drvdata(pdev);
663663

664664
if (!dev)
665-
return 0;
665+
return;
666666

667667
b53_srab_intr_set(dev->priv, false);
668668
b53_switch_remove(dev);
669-
670-
return 0;
671669
}
672670

673671
static void b53_srab_shutdown(struct platform_device *pdev)
@@ -684,7 +682,7 @@ static void b53_srab_shutdown(struct platform_device *pdev)
684682

685683
static struct platform_driver b53_srab_driver = {
686684
.probe = b53_srab_probe,
687-
.remove = b53_srab_remove,
685+
.remove_new = b53_srab_remove,
688686
.shutdown = b53_srab_shutdown,
689687
.driver = {
690688
.name = "b53-srab-switch",

drivers/net/dsa/bcm_sf2.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,12 +1537,12 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
15371537
return ret;
15381538
}
15391539

1540-
static int bcm_sf2_sw_remove(struct platform_device *pdev)
1540+
static void bcm_sf2_sw_remove(struct platform_device *pdev)
15411541
{
15421542
struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
15431543

15441544
if (!priv)
1545-
return 0;
1545+
return;
15461546

15471547
priv->wol_ports_mask = 0;
15481548
/* Disable interrupts */
@@ -1554,8 +1554,6 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
15541554
clk_disable_unprepare(priv->clk);
15551555
if (priv->type == BCM7278_DEVICE_ID)
15561556
reset_control_assert(priv->rcdev);
1557-
1558-
return 0;
15591557
}
15601558

15611559
static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
@@ -1601,7 +1599,7 @@ static SIMPLE_DEV_PM_OPS(bcm_sf2_pm_ops,
16011599

16021600
static struct platform_driver bcm_sf2_driver = {
16031601
.probe = bcm_sf2_sw_probe,
1604-
.remove = bcm_sf2_sw_remove,
1602+
.remove_new = bcm_sf2_sw_remove,
16051603
.shutdown = bcm_sf2_sw_shutdown,
16061604
.driver = {
16071605
.name = "brcm-sf2",

drivers/net/dsa/hirschmann/hellcreek.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,18 +2060,16 @@ static int hellcreek_probe(struct platform_device *pdev)
20602060
return ret;
20612061
}
20622062

2063-
static int hellcreek_remove(struct platform_device *pdev)
2063+
static void hellcreek_remove(struct platform_device *pdev)
20642064
{
20652065
struct hellcreek *hellcreek = platform_get_drvdata(pdev);
20662066

20672067
if (!hellcreek)
2068-
return 0;
2068+
return;
20692069

20702070
hellcreek_hwtstamp_free(hellcreek);
20712071
hellcreek_ptp_free(hellcreek);
20722072
dsa_unregister_switch(hellcreek->ds);
2073-
2074-
return 0;
20752073
}
20762074

20772075
static void hellcreek_shutdown(struct platform_device *pdev)
@@ -2107,7 +2105,7 @@ MODULE_DEVICE_TABLE(of, hellcreek_of_match);
21072105

21082106
static struct platform_driver hellcreek_driver = {
21092107
.probe = hellcreek_probe,
2110-
.remove = hellcreek_remove,
2108+
.remove_new = hellcreek_remove,
21112109
.shutdown = hellcreek_shutdown,
21122110
.driver = {
21132111
.name = "hellcreek",

drivers/net/dsa/lantiq_gswip.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,13 +2207,13 @@ static int gswip_probe(struct platform_device *pdev)
22072207
return err;
22082208
}
22092209

2210-
static int gswip_remove(struct platform_device *pdev)
2210+
static void gswip_remove(struct platform_device *pdev)
22112211
{
22122212
struct gswip_priv *priv = platform_get_drvdata(pdev);
22132213
int i;
22142214

22152215
if (!priv)
2216-
return 0;
2216+
return;
22172217

22182218
/* disable the switch */
22192219
gswip_mdio_mask(priv, GSWIP_MDIO_GLOB_ENABLE, 0, GSWIP_MDIO_GLOB);
@@ -2228,8 +2228,6 @@ static int gswip_remove(struct platform_device *pdev)
22282228

22292229
for (i = 0; i < priv->num_gphy_fw; i++)
22302230
gswip_gphy_fw_remove(priv, &priv->gphy_fw[i]);
2231-
2232-
return 0;
22332231
}
22342232

22352233
static void gswip_shutdown(struct platform_device *pdev)
@@ -2266,7 +2264,7 @@ MODULE_DEVICE_TABLE(of, gswip_of_match);
22662264

22672265
static struct platform_driver gswip_driver = {
22682266
.probe = gswip_probe,
2269-
.remove = gswip_remove,
2267+
.remove_new = gswip_remove,
22702268
.shutdown = gswip_shutdown,
22712269
.driver = {
22722270
.name = "gswip",

drivers/net/dsa/mt7530-mmio.c

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

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

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

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

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

drivers/net/dsa/ocelot/ocelot_ext.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,17 @@ static int ocelot_ext_probe(struct platform_device *pdev)
115115
return err;
116116
}
117117

118-
static int ocelot_ext_remove(struct platform_device *pdev)
118+
static void ocelot_ext_remove(struct platform_device *pdev)
119119
{
120120
struct felix *felix = dev_get_drvdata(&pdev->dev);
121121

122122
if (!felix)
123-
return 0;
123+
return;
124124

125125
dsa_unregister_switch(felix->ds);
126126

127127
kfree(felix->ds);
128128
kfree(felix);
129-
130-
return 0;
131129
}
132130

133131
static void ocelot_ext_shutdown(struct platform_device *pdev)
@@ -154,7 +152,7 @@ static struct platform_driver ocelot_ext_switch_driver = {
154152
.of_match_table = ocelot_ext_switch_of_match,
155153
},
156154
.probe = ocelot_ext_probe,
157-
.remove = ocelot_ext_remove,
155+
.remove_new = ocelot_ext_remove,
158156
.shutdown = ocelot_ext_shutdown,
159157
};
160158
module_platform_driver(ocelot_ext_switch_driver);

drivers/net/dsa/ocelot/seville_vsc9953.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,19 +1029,17 @@ static int seville_probe(struct platform_device *pdev)
10291029
return err;
10301030
}
10311031

1032-
static int seville_remove(struct platform_device *pdev)
1032+
static void seville_remove(struct platform_device *pdev)
10331033
{
10341034
struct felix *felix = platform_get_drvdata(pdev);
10351035

10361036
if (!felix)
1037-
return 0;
1037+
return;
10381038

10391039
dsa_unregister_switch(felix->ds);
10401040

10411041
kfree(felix->ds);
10421042
kfree(felix);
1043-
1044-
return 0;
10451043
}
10461044

10471045
static void seville_shutdown(struct platform_device *pdev)
@@ -1064,7 +1062,7 @@ MODULE_DEVICE_TABLE(of, seville_of_match);
10641062

10651063
static struct platform_driver seville_vsc9953_driver = {
10661064
.probe = seville_probe,
1067-
.remove = seville_remove,
1065+
.remove_new = seville_remove,
10681066
.shutdown = seville_shutdown,
10691067
.driver = {
10701068
.name = "mscc_seville",

drivers/net/dsa/realtek/realtek-smi.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,12 @@ static int realtek_smi_probe(struct platform_device *pdev)
506506
return 0;
507507
}
508508

509-
static int realtek_smi_remove(struct platform_device *pdev)
509+
static void realtek_smi_remove(struct platform_device *pdev)
510510
{
511511
struct realtek_priv *priv = platform_get_drvdata(pdev);
512512

513513
if (!priv)
514-
return 0;
514+
return;
515515

516516
dsa_unregister_switch(priv->ds);
517517
if (priv->slave_mii_bus)
@@ -520,8 +520,6 @@ static int realtek_smi_remove(struct platform_device *pdev)
520520
/* leave the device reset asserted */
521521
if (priv->reset)
522522
gpiod_set_value(priv->reset, 1);
523-
524-
return 0;
525523
}
526524

527525
static void realtek_smi_shutdown(struct platform_device *pdev)
@@ -559,7 +557,7 @@ static struct platform_driver realtek_smi_driver = {
559557
.of_match_table = realtek_smi_of_match,
560558
},
561559
.probe = realtek_smi_probe,
562-
.remove = realtek_smi_remove,
560+
.remove_new = realtek_smi_remove,
563561
.shutdown = realtek_smi_shutdown,
564562
};
565563
module_platform_driver(realtek_smi_driver);

drivers/net/dsa/rzn1_a5psw.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,19 +1272,17 @@ static int a5psw_probe(struct platform_device *pdev)
12721272
return ret;
12731273
}
12741274

1275-
static int a5psw_remove(struct platform_device *pdev)
1275+
static void a5psw_remove(struct platform_device *pdev)
12761276
{
12771277
struct a5psw *a5psw = platform_get_drvdata(pdev);
12781278

12791279
if (!a5psw)
1280-
return 0;
1280+
return;
12811281

12821282
dsa_unregister_switch(&a5psw->ds);
12831283
a5psw_pcs_free(a5psw);
12841284
clk_disable_unprepare(a5psw->hclk);
12851285
clk_disable_unprepare(a5psw->clk);
1286-
1287-
return 0;
12881286
}
12891287

12901288
static void a5psw_shutdown(struct platform_device *pdev)
@@ -1311,7 +1309,7 @@ static struct platform_driver a5psw_driver = {
13111309
.of_match_table = a5psw_of_mtable,
13121310
},
13131311
.probe = a5psw_probe,
1314-
.remove = a5psw_remove,
1312+
.remove_new = a5psw_remove,
13151313
.shutdown = a5psw_shutdown,
13161314
};
13171315
module_platform_driver(a5psw_driver);

0 commit comments

Comments
 (0)