* [PATCH] register at91_ether using platform_driver_probe
[not found] <200907111527.46441.david-b@pacbell.net>
@ 2009-07-21 20:11 ` Uwe Kleine-König
2009-07-22 17:37 ` David Brownell
2009-07-22 17:46 ` Andrew Victor
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2009-07-21 20:11 UTC (permalink / raw)
To: linux-kernel
Cc: David Brownell, netdev, Paulius Zaleckas, Marc Pignat,
Andrew Victor, Roel Kluin, Andrew Morton, Greg Kroah-Hartman
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>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: netdev@vger.kernel.org
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Marc Pignat <marc.pignat@hevs.ch>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.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)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] register at91_ether using platform_driver_probe
2009-07-21 20:11 ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
@ 2009-07-22 17:37 ` David Brownell
2009-07-22 17:46 ` Andrew Victor
1 sibling, 0 replies; 4+ messages in thread
From: David Brownell @ 2009-07-22 17:37 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-kernel, David Brownell, netdev, Paulius Zaleckas,
Marc Pignat, Andrew Victor, Roel Kluin, Andrew Morton,
Greg Kroah-Hartman
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@pengutronix.de>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
.... and thanks for doing it this way. :)
> Cc: netdev@vger.kernel.org
> Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
> Cc: Marc Pignat <marc.pignat@hevs.ch>
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Roel Kluin <12o3l@tiscali.nl>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@suse.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)
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] register at91_ether using platform_driver_probe
2009-07-21 20:11 ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
2009-07-22 17:37 ` David Brownell
@ 2009-07-22 17:46 ` Andrew Victor
2009-07-22 18:24 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Victor @ 2009-07-22 17:46 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: linux-kernel, David Brownell, netdev, Paulius Zaleckas,
Marc Pignat, Andrew Victor, Roel Kluin, Andrew Morton,
Greg Kroah-Hartman
hi,
> 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.
Acked-by: Andrew Victor <linux@maxim.org.za>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] register at91_ether using platform_driver_probe
2009-07-22 17:46 ` Andrew Victor
@ 2009-07-22 18:24 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-07-22 18:24 UTC (permalink / raw)
To: avictor.za
Cc: u.kleine-koenig, linux-kernel, dbrownell, netdev,
paulius.zaleckas, marc.pignat, linux, 12o3l, akpm, gregkh
From: Andrew Victor <avictor.za@gmail.com>
Date: Wed, 22 Jul 2009 19:46:24 +0200
> hi,
>
>> 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.
>
>
> Acked-by: Andrew Victor <linux@maxim.org.za>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-22 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200907111527.46441.david-b@pacbell.net>
2009-07-21 20:11 ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
2009-07-22 17:37 ` David Brownell
2009-07-22 17:46 ` Andrew Victor
2009-07-22 18:24 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).