diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-07-11 16:52:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-21 15:20:18 -0400 |
commit | 25177476675142d3ebd60849e0cebc46bd1eef8e (patch) | |
tree | 134ec077e811e390a35184c3c2b5b9b263236428 /drivers/net/macsonic.c | |
parent | 1b0d92244ff2434a98272f6d2525da32fc230f19 (diff) |
macsonic: move probe function to .devinit.text
A pointer to mac_sonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
Various other functions that are called by mac_sonic_probe need to move
to .devinit.text, too.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macsonic.c')
-rw-r--r-- | drivers/net/macsonic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c index acd143da161d..8f492c7b8093 100644 --- a/drivers/net/macsonic.c +++ b/drivers/net/macsonic.c | |||
@@ -179,7 +179,7 @@ static const struct net_device_ops macsonic_netdev_ops = { | |||
179 | .ndo_set_mac_address = eth_mac_addr, | 179 | .ndo_set_mac_address = eth_mac_addr, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static int __init macsonic_init(struct net_device *dev) | 182 | static int __devinit macsonic_init(struct net_device *dev) |
183 | { | 183 | { |
184 | struct sonic_local* lp = netdev_priv(dev); | 184 | struct sonic_local* lp = netdev_priv(dev); |
185 | 185 | ||
@@ -223,7 +223,7 @@ static int __init macsonic_init(struct net_device *dev) | |||
223 | return 0; | 223 | return 0; |
224 | } | 224 | } |
225 | 225 | ||
226 | static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev) | 226 | static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) |
227 | { | 227 | { |
228 | struct sonic_local *lp = netdev_priv(dev); | 228 | struct sonic_local *lp = netdev_priv(dev); |
229 | const int prom_addr = ONBOARD_SONIC_PROM_BASE; | 229 | const int prom_addr = ONBOARD_SONIC_PROM_BASE; |
@@ -288,7 +288,7 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev) | |||
288 | } else return 0; | 288 | } else return 0; |
289 | } | 289 | } |
290 | 290 | ||
291 | static int __init mac_onboard_sonic_probe(struct net_device *dev) | 291 | static int __devinit mac_onboard_sonic_probe(struct net_device *dev) |
292 | { | 292 | { |
293 | /* Bwahahaha */ | 293 | /* Bwahahaha */ |
294 | static int once_is_more_than_enough; | 294 | static int once_is_more_than_enough; |
@@ -409,7 +409,7 @@ static int __init mac_onboard_sonic_probe(struct net_device *dev) | |||
409 | return macsonic_init(dev); | 409 | return macsonic_init(dev); |
410 | } | 410 | } |
411 | 411 | ||
412 | static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev, | 412 | static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev, |
413 | unsigned long prom_addr, | 413 | unsigned long prom_addr, |
414 | int id) | 414 | int id) |
415 | { | 415 | { |
@@ -424,7 +424,7 @@ static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev, | |||
424 | return 0; | 424 | return 0; |
425 | } | 425 | } |
426 | 426 | ||
427 | static int __init macsonic_ident(struct nubus_dev *ndev) | 427 | static int __devinit macsonic_ident(struct nubus_dev *ndev) |
428 | { | 428 | { |
429 | if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC && | 429 | if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC && |
430 | ndev->dr_sw == NUBUS_DRSW_SONIC_LC) | 430 | ndev->dr_sw == NUBUS_DRSW_SONIC_LC) |
@@ -449,7 +449,7 @@ static int __init macsonic_ident(struct nubus_dev *ndev) | |||
449 | return -1; | 449 | return -1; |
450 | } | 450 | } |
451 | 451 | ||
452 | static int __init mac_nubus_sonic_probe(struct net_device *dev) | 452 | static int __devinit mac_nubus_sonic_probe(struct net_device *dev) |
453 | { | 453 | { |
454 | static int slots; | 454 | static int slots; |
455 | struct nubus_dev* ndev = NULL; | 455 | struct nubus_dev* ndev = NULL; |
@@ -562,7 +562,7 @@ static int __init mac_nubus_sonic_probe(struct net_device *dev) | |||
562 | return macsonic_init(dev); | 562 | return macsonic_init(dev); |
563 | } | 563 | } |
564 | 564 | ||
565 | static int __init mac_sonic_probe(struct platform_device *pdev) | 565 | static int __devinit mac_sonic_probe(struct platform_device *pdev) |
566 | { | 566 | { |
567 | struct net_device *dev; | 567 | struct net_device *dev; |
568 | struct sonic_local *lp; | 568 | struct sonic_local *lp; |