Skip to content

Commit be12502

Browse files
dtordavem330
authored andcommitted
drivers: net: ethernet: remove incorrect __exit markups
Even if bus is not hot-pluggable, devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7db9236 commit be12502

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

drivers/net/ethernet/amd/declance.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,18 +1276,6 @@ static int dec_lance_probe(struct device *bdev, const int type)
12761276
return ret;
12771277
}
12781278

1279-
static void __exit dec_lance_remove(struct device *bdev)
1280-
{
1281-
struct net_device *dev = dev_get_drvdata(bdev);
1282-
resource_size_t start, len;
1283-
1284-
unregister_netdev(dev);
1285-
start = to_tc_dev(bdev)->resource.start;
1286-
len = to_tc_dev(bdev)->resource.end - start + 1;
1287-
release_mem_region(start, len);
1288-
free_netdev(dev);
1289-
}
1290-
12911279
/* Find all the lance cards on the system and initialize them */
12921280
static int __init dec_lance_platform_probe(void)
12931281
{
@@ -1320,7 +1308,7 @@ static void __exit dec_lance_platform_remove(void)
13201308

13211309
#ifdef CONFIG_TC
13221310
static int dec_lance_tc_probe(struct device *dev);
1323-
static int __exit dec_lance_tc_remove(struct device *dev);
1311+
static int dec_lance_tc_remove(struct device *dev);
13241312

13251313
static const struct tc_device_id dec_lance_tc_table[] = {
13261314
{ "DEC ", "PMAD-AA " },
@@ -1334,7 +1322,7 @@ static struct tc_driver dec_lance_tc_driver = {
13341322
.name = "declance",
13351323
.bus = &tc_bus_type,
13361324
.probe = dec_lance_tc_probe,
1337-
.remove = __exit_p(dec_lance_tc_remove),
1325+
.remove = dec_lance_tc_remove,
13381326
},
13391327
};
13401328

@@ -1346,7 +1334,19 @@ static int dec_lance_tc_probe(struct device *dev)
13461334
return status;
13471335
}
13481336

1349-
static int __exit dec_lance_tc_remove(struct device *dev)
1337+
static void dec_lance_remove(struct device *bdev)
1338+
{
1339+
struct net_device *dev = dev_get_drvdata(bdev);
1340+
resource_size_t start, len;
1341+
1342+
unregister_netdev(dev);
1343+
start = to_tc_dev(bdev)->resource.start;
1344+
len = to_tc_dev(bdev)->resource.end - start + 1;
1345+
release_mem_region(start, len);
1346+
free_netdev(dev);
1347+
}
1348+
1349+
static int dec_lance_tc_remove(struct device *dev)
13501350
{
13511351
put_device(dev);
13521352
dec_lance_remove(dev);

drivers/net/ethernet/broadcom/sb1250-mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,7 +2617,7 @@ static int sbmac_probe(struct platform_device *pldev)
26172617
return err;
26182618
}
26192619

2620-
static int __exit sbmac_remove(struct platform_device *pldev)
2620+
static int sbmac_remove(struct platform_device *pldev)
26212621
{
26222622
struct net_device *dev = platform_get_drvdata(pldev);
26232623
struct sbmac_softc *sc = netdev_priv(dev);
@@ -2634,7 +2634,7 @@ static int __exit sbmac_remove(struct platform_device *pldev)
26342634

26352635
static struct platform_driver sbmac_driver = {
26362636
.probe = sbmac_probe,
2637-
.remove = __exit_p(sbmac_remove),
2637+
.remove = sbmac_remove,
26382638
.driver = {
26392639
.name = sbmac_string,
26402640
},

drivers/net/ethernet/faraday/ftgmac100.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
14561456
return err;
14571457
}
14581458

1459-
static int __exit ftgmac100_remove(struct platform_device *pdev)
1459+
static int ftgmac100_remove(struct platform_device *pdev)
14601460
{
14611461
struct net_device *netdev;
14621462
struct ftgmac100 *priv;
@@ -1483,7 +1483,7 @@ MODULE_DEVICE_TABLE(of, ftgmac100_of_match);
14831483

14841484
static struct platform_driver ftgmac100_driver = {
14851485
.probe = ftgmac100_probe,
1486-
.remove = __exit_p(ftgmac100_remove),
1486+
.remove = ftgmac100_remove,
14871487
.driver = {
14881488
.name = DRV_NAME,
14891489
.of_match_table = ftgmac100_of_match,

drivers/net/ethernet/faraday/ftmac100.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ static int ftmac100_probe(struct platform_device *pdev)
11561156
return err;
11571157
}
11581158

1159-
static int __exit ftmac100_remove(struct platform_device *pdev)
1159+
static int ftmac100_remove(struct platform_device *pdev)
11601160
{
11611161
struct net_device *netdev;
11621162
struct ftmac100 *priv;
@@ -1176,7 +1176,7 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
11761176

11771177
static struct platform_driver ftmac100_driver = {
11781178
.probe = ftmac100_probe,
1179-
.remove = __exit_p(ftmac100_remove),
1179+
.remove = ftmac100_remove,
11801180
.driver = {
11811181
.name = DRV_NAME,
11821182
},

drivers/net/ethernet/seeq/sgiseeq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ static int sgiseeq_probe(struct platform_device *pdev)
807807
return err;
808808
}
809809

810-
static int __exit sgiseeq_remove(struct platform_device *pdev)
810+
static int sgiseeq_remove(struct platform_device *pdev)
811811
{
812812
struct net_device *dev = platform_get_drvdata(pdev);
813813
struct sgiseeq_private *sp = netdev_priv(dev);
@@ -822,7 +822,7 @@ static int __exit sgiseeq_remove(struct platform_device *pdev)
822822

823823
static struct platform_driver sgiseeq_driver = {
824824
.probe = sgiseeq_probe,
825-
.remove = __exit_p(sgiseeq_remove),
825+
.remove = sgiseeq_remove,
826826
.driver = {
827827
.name = "sgiseeq",
828828
}

drivers/net/ethernet/sgi/meth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ static int meth_probe(struct platform_device *pdev)
854854
return 0;
855855
}
856856

857-
static int __exit meth_remove(struct platform_device *pdev)
857+
static int meth_remove(struct platform_device *pdev)
858858
{
859859
struct net_device *dev = platform_get_drvdata(pdev);
860860

@@ -866,7 +866,7 @@ static int __exit meth_remove(struct platform_device *pdev)
866866

867867
static struct platform_driver meth_driver = {
868868
.probe = meth_probe,
869-
.remove = __exit_p(meth_remove),
869+
.remove = meth_remove,
870870
.driver = {
871871
.name = "meth",
872872
}

0 commit comments

Comments
 (0)