[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200907221037.36541.david-b@pacbell.net>
Date: Wed, 22 Jul 2009 10:37:36 -0700
From: David Brownell <david-b@...bell.net>
To: "Uwe Kleine-König"
<u.kleine-koenig@...gutronix.de>
Cc: linux-kernel@...r.kernel.org,
David Brownell <dbrownell@...rs.sourceforge.net>,
netdev@...r.kernel.org,
Paulius Zaleckas <paulius.zaleckas@...tonika.lt>,
Marc Pignat <marc.pignat@...s.ch>,
Andrew Victor <linux@...im.org.za>,
Roel Kluin <12o3l@...cali.nl>,
Andrew Morton <akpm@...ux-foundation.org>,
"Greg Kroah-Hartman" <gregkh@...e.de>
Subject: Re: [PATCH] register at91_ether using platform_driver_probe
On Tuesday 21 July 2009, Uwe Kleine-König wrote:
> 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.
Right, these devices do not hotplug.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> Cc: David Brownell <dbrownell@...rs.sourceforge.net>
Acked-by: David Brownell <dbrownell@...rs.sourceforge.net>
.... and thanks for doing it this way. :)
> Cc: netdev@...r.kernel.org
> Cc: Paulius Zaleckas <paulius.zaleckas@...tonika.lt>
> Cc: Marc Pignat <marc.pignat@...s.ch>
> Cc: Andrew Victor <linux@...im.org.za>
> Cc: Roel Kluin <12o3l@...cali.nl>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@...e.de>
>
> ---
> drivers/net/arm/at91_ether.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
> index 2e7419a..5041d10 100644
> --- a/drivers/net/arm/at91_ether.c
> +++ b/drivers/net/arm/at91_ether.c
> @@ -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)
> --
> tg: (4b0a840..) t/platsection/at91ether_driver (depends on: linus/master)
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists