diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-03-01 20:24:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-02 17:33:49 -0500 |
commit | be12502e2e64854dbe0a2ddff6d26ec1143d6890 (patch) | |
tree | 147e0110de4d5228f09def2d8c112f69fb62b87c | |
parent | 7db92362d2fee5887f6b0c41653b8c9f8f5d6020 (diff) |
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 <dmitry.torokhov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/amd/declance.c | 30 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/sb1250-mac.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/faraday/ftgmac100.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/faraday/ftmac100.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/seeq/sgiseeq.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/sgi/meth.c | 4 |
6 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c index 76e5fc7adff5..6c98901f1b89 100644 --- a/drivers/net/ethernet/amd/declance.c +++ b/drivers/net/ethernet/amd/declance.c | |||
@@ -1276,18 +1276,6 @@ err_out: | |||
1276 | return ret; | 1276 | return ret; |
1277 | } | 1277 | } |
1278 | 1278 | ||
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 | |||
1291 | /* Find all the lance cards on the system and initialize them */ | 1279 | /* Find all the lance cards on the system and initialize them */ |
1292 | static int __init dec_lance_platform_probe(void) | 1280 | static int __init dec_lance_platform_probe(void) |
1293 | { | 1281 | { |
@@ -1320,7 +1308,7 @@ static void __exit dec_lance_platform_remove(void) | |||
1320 | 1308 | ||
1321 | #ifdef CONFIG_TC | 1309 | #ifdef CONFIG_TC |
1322 | static int dec_lance_tc_probe(struct device *dev); | 1310 | 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); |
1324 | 1312 | ||
1325 | static const struct tc_device_id dec_lance_tc_table[] = { | 1313 | static const struct tc_device_id dec_lance_tc_table[] = { |
1326 | { "DEC ", "PMAD-AA " }, | 1314 | { "DEC ", "PMAD-AA " }, |
@@ -1334,7 +1322,7 @@ static struct tc_driver dec_lance_tc_driver = { | |||
1334 | .name = "declance", | 1322 | .name = "declance", |
1335 | .bus = &tc_bus_type, | 1323 | .bus = &tc_bus_type, |
1336 | .probe = dec_lance_tc_probe, | 1324 | .probe = dec_lance_tc_probe, |
1337 | .remove = __exit_p(dec_lance_tc_remove), | 1325 | .remove = dec_lance_tc_remove, |
1338 | }, | 1326 | }, |
1339 | }; | 1327 | }; |
1340 | 1328 | ||
@@ -1346,7 +1334,19 @@ static int dec_lance_tc_probe(struct device *dev) | |||
1346 | return status; | 1334 | return status; |
1347 | } | 1335 | } |
1348 | 1336 | ||
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) | ||
1350 | { | 1350 | { |
1351 | put_device(dev); | 1351 | put_device(dev); |
1352 | dec_lance_remove(dev); | 1352 | dec_lance_remove(dev); |
diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c index 89d4feba1a9a..55c8e25b43d9 100644 --- a/drivers/net/ethernet/broadcom/sb1250-mac.c +++ b/drivers/net/ethernet/broadcom/sb1250-mac.c | |||
@@ -2617,7 +2617,7 @@ out_out: | |||
2617 | return err; | 2617 | return err; |
2618 | } | 2618 | } |
2619 | 2619 | ||
2620 | static int __exit sbmac_remove(struct platform_device *pldev) | 2620 | static int sbmac_remove(struct platform_device *pldev) |
2621 | { | 2621 | { |
2622 | struct net_device *dev = platform_get_drvdata(pldev); | 2622 | struct net_device *dev = platform_get_drvdata(pldev); |
2623 | struct sbmac_softc *sc = netdev_priv(dev); | 2623 | struct sbmac_softc *sc = netdev_priv(dev); |
@@ -2634,7 +2634,7 @@ static int __exit sbmac_remove(struct platform_device *pldev) | |||
2634 | 2634 | ||
2635 | static struct platform_driver sbmac_driver = { | 2635 | static struct platform_driver sbmac_driver = { |
2636 | .probe = sbmac_probe, | 2636 | .probe = sbmac_probe, |
2637 | .remove = __exit_p(sbmac_remove), | 2637 | .remove = sbmac_remove, |
2638 | .driver = { | 2638 | .driver = { |
2639 | .name = sbmac_string, | 2639 | .name = sbmac_string, |
2640 | }, | 2640 | }, |
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 262587240c86..928b0df2b8e0 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c | |||
@@ -1456,7 +1456,7 @@ err_alloc_etherdev: | |||
1456 | return err; | 1456 | return err; |
1457 | } | 1457 | } |
1458 | 1458 | ||
1459 | static int __exit ftgmac100_remove(struct platform_device *pdev) | 1459 | static int ftgmac100_remove(struct platform_device *pdev) |
1460 | { | 1460 | { |
1461 | struct net_device *netdev; | 1461 | struct net_device *netdev; |
1462 | struct ftgmac100 *priv; | 1462 | struct ftgmac100 *priv; |
@@ -1483,7 +1483,7 @@ MODULE_DEVICE_TABLE(of, ftgmac100_of_match); | |||
1483 | 1483 | ||
1484 | static struct platform_driver ftgmac100_driver = { | 1484 | static struct platform_driver ftgmac100_driver = { |
1485 | .probe = ftgmac100_probe, | 1485 | .probe = ftgmac100_probe, |
1486 | .remove = __exit_p(ftgmac100_remove), | 1486 | .remove = ftgmac100_remove, |
1487 | .driver = { | 1487 | .driver = { |
1488 | .name = DRV_NAME, | 1488 | .name = DRV_NAME, |
1489 | .of_match_table = ftgmac100_of_match, | 1489 | .of_match_table = ftgmac100_of_match, |
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c index c0ddbbe6c226..6ac336b546e6 100644 --- a/drivers/net/ethernet/faraday/ftmac100.c +++ b/drivers/net/ethernet/faraday/ftmac100.c | |||
@@ -1156,7 +1156,7 @@ err_alloc_etherdev: | |||
1156 | return err; | 1156 | return err; |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static int __exit ftmac100_remove(struct platform_device *pdev) | 1159 | static int ftmac100_remove(struct platform_device *pdev) |
1160 | { | 1160 | { |
1161 | struct net_device *netdev; | 1161 | struct net_device *netdev; |
1162 | struct ftmac100 *priv; | 1162 | struct ftmac100 *priv; |
@@ -1176,7 +1176,7 @@ static int __exit ftmac100_remove(struct platform_device *pdev) | |||
1176 | 1176 | ||
1177 | static struct platform_driver ftmac100_driver = { | 1177 | static struct platform_driver ftmac100_driver = { |
1178 | .probe = ftmac100_probe, | 1178 | .probe = ftmac100_probe, |
1179 | .remove = __exit_p(ftmac100_remove), | 1179 | .remove = ftmac100_remove, |
1180 | .driver = { | 1180 | .driver = { |
1181 | .name = DRV_NAME, | 1181 | .name = DRV_NAME, |
1182 | }, | 1182 | }, |
diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c index ed34196028b8..70347720fdf9 100644 --- a/drivers/net/ethernet/seeq/sgiseeq.c +++ b/drivers/net/ethernet/seeq/sgiseeq.c | |||
@@ -807,7 +807,7 @@ err_out: | |||
807 | return err; | 807 | return err; |
808 | } | 808 | } |
809 | 809 | ||
810 | static int __exit sgiseeq_remove(struct platform_device *pdev) | 810 | static int sgiseeq_remove(struct platform_device *pdev) |
811 | { | 811 | { |
812 | struct net_device *dev = platform_get_drvdata(pdev); | 812 | struct net_device *dev = platform_get_drvdata(pdev); |
813 | struct sgiseeq_private *sp = netdev_priv(dev); | 813 | struct sgiseeq_private *sp = netdev_priv(dev); |
@@ -822,7 +822,7 @@ static int __exit sgiseeq_remove(struct platform_device *pdev) | |||
822 | 822 | ||
823 | static struct platform_driver sgiseeq_driver = { | 823 | static struct platform_driver sgiseeq_driver = { |
824 | .probe = sgiseeq_probe, | 824 | .probe = sgiseeq_probe, |
825 | .remove = __exit_p(sgiseeq_remove), | 825 | .remove = sgiseeq_remove, |
826 | .driver = { | 826 | .driver = { |
827 | .name = "sgiseeq", | 827 | .name = "sgiseeq", |
828 | } | 828 | } |
diff --git a/drivers/net/ethernet/sgi/meth.c b/drivers/net/ethernet/sgi/meth.c index 69d2d30e5ef1..ea55abd62ec7 100644 --- a/drivers/net/ethernet/sgi/meth.c +++ b/drivers/net/ethernet/sgi/meth.c | |||
@@ -854,7 +854,7 @@ static int meth_probe(struct platform_device *pdev) | |||
854 | return 0; | 854 | return 0; |
855 | } | 855 | } |
856 | 856 | ||
857 | static int __exit meth_remove(struct platform_device *pdev) | 857 | static int meth_remove(struct platform_device *pdev) |
858 | { | 858 | { |
859 | struct net_device *dev = platform_get_drvdata(pdev); | 859 | struct net_device *dev = platform_get_drvdata(pdev); |
860 | 860 | ||
@@ -866,7 +866,7 @@ static int __exit meth_remove(struct platform_device *pdev) | |||
866 | 866 | ||
867 | static struct platform_driver meth_driver = { | 867 | static struct platform_driver meth_driver = { |
868 | .probe = meth_probe, | 868 | .probe = meth_probe, |
869 | .remove = __exit_p(meth_remove), | 869 | .remove = meth_remove, |
870 | .driver = { | 870 | .driver = { |
871 | .name = "meth", | 871 | .name = "meth", |
872 | } | 872 | } |