]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
register at91_ether using platform_driver_probe
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 21 Jul 2009 10:11:39 +0000 (10:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jul 2009 18:24:28 +0000 (11:24 -0700)
at91ether_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.

As requested by David Brownell platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/arm/at91_ether.c

index 2e7419a6119181b29538720114e59b74bf15c578..5041d10bae9d9611c280ad50b17068349e9decd9 100644 (file)
@@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
 #endif
 
 static struct platform_driver at91ether_driver = {
-       .probe          = at91ether_probe,
        .remove         = __devexit_p(at91ether_remove),
        .suspend        = at91ether_suspend,
        .resume         = at91ether_resume,
@@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
 
 static int __init at91ether_init(void)
 {
-       return platform_driver_register(&at91ether_driver);
+       return platform_driver_probe(&at91ether_driver, at91ether_probe);
 }
 
 static void __exit at91ether_exit(void)