* [PATCH] Use platform_driver_probe for pio platform driver
@ 2008-09-21 21:52 Uwe Kleine-König
2008-09-21 21:52 ` [PATCH] Use platform_driver_probe for pdc " Uwe Kleine-König
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2008-09-21 21:52 UTC (permalink / raw)
To: linux-kernel; +Cc: Haavard Skinnemoen
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]
The probe function of the pio platform driver lives in the init section
and so a pio device that is created after the init section is discarded
probably results in an oops. Even if this cannot happen, using
platform_driver_probe is cleaner. (If this can happen and should be
supported the probe function must live in the devinit section instead.)
Signed-off-by: Uwe Kleine-König <ukleinek@strlen.de>
Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
---
arch/avr32/mach-at32ap/pio.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index 405ee6b..96a6d5d 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -382,7 +382,6 @@ static int __init pio_probe(struct platform_device *pdev)
}
static struct platform_driver pio_driver = {
- .probe = pio_probe,
.driver = {
.name = "pio",
},
@@ -390,7 +389,7 @@ static struct platform_driver pio_driver = {
static int __init pio_init(void)
{
- return platform_driver_register(&pio_driver);
+ return platform_driver_probe(&pio_driver, pio_probe);
}
postcore_initcall(pio_init);
--
tg: (852b98c..) t/sectionfixes/pio (depends on: t/sectionfixes/h1940bt)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Use platform_driver_probe for pdc platform driver
2008-09-21 21:52 [PATCH] Use platform_driver_probe for pio platform driver Uwe Kleine-König
@ 2008-09-21 21:52 ` Uwe Kleine-König
2008-09-22 8:30 ` Haavard Skinnemoen
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2008-09-21 21:52 UTC (permalink / raw)
To: linux-kernel; +Cc: Haavard Skinnemoen
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]
The probe function of the pdc platform driver lives in the init section
and so a pdc device that is created after the init section is discarded
probably results in an oops. Even if this cannot happen, using
platform_driver_probe is cleaner. (If this can happen and should be
supported the probe function must live in the devinit section instead.)
Signed-off-by: Uwe Kleine-König <ukleinek@strlen.de>
Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
---
arch/avr32/mach-at32ap/pdc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/avr32/mach-at32ap/pdc.c b/arch/avr32/mach-at32ap/pdc.c
index 1040bda..61ab15a 100644
--- a/arch/avr32/mach-at32ap/pdc.c
+++ b/arch/avr32/mach-at32ap/pdc.c
@@ -35,7 +35,6 @@ static int __init pdc_probe(struct platform_device *pdev)
}
static struct platform_driver pdc_driver = {
- .probe = pdc_probe,
.driver = {
.name = "pdc",
},
@@ -43,6 +42,6 @@ static struct platform_driver pdc_driver = {
static int __init pdc_init(void)
{
- return platform_driver_register(&pdc_driver);
+ return platform_driver_probe(&pdc_driver, pdc_probe);
}
arch_initcall(pdc_init);
--
tg: (639920b..) t/sectionfixes/pdc (depends on: t/sectionfixes/pio)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Use platform_driver_probe for pdc platform driver
2008-09-21 21:52 ` [PATCH] Use platform_driver_probe for pdc " Uwe Kleine-König
@ 2008-09-22 8:30 ` Haavard Skinnemoen
0 siblings, 0 replies; 3+ messages in thread
From: Haavard Skinnemoen @ 2008-09-22 8:30 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-kernel
Uwe Kleine-König <ukleinek@strlen.de> wrote:
> The probe function of the pdc platform driver lives in the init section
> and so a pdc device that is created after the init section is discarded
> probably results in an oops. Even if this cannot happen, using
> platform_driver_probe is cleaner. (If this can happen and should be
> supported the probe function must live in the devinit section instead.)
>
> Signed-off-by: Uwe Kleine-König <ukleinek@strlen.de>
> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Applied both this and the pio one. Thanks!
Haavard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-09-22 8:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-21 21:52 [PATCH] Use platform_driver_probe for pio platform driver Uwe Kleine-König
2008-09-21 21:52 ` [PATCH] Use platform_driver_probe for pdc " Uwe Kleine-König
2008-09-22 8:30 ` Haavard Skinnemoen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®