Skip to contentSkip to conversation

Use platform_driver_probe for pio platform driver

PATCH New Uwe Kleine-König 2 participants 3 messages Sep 21, 2008 – Sep 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use platform_driver_probe for pio platform driver

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.)

Cc Haavard Skinnemoen <[email protected]>
---
 arch/avr32/mach-at32ap/pio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/pio.c +1 -2
index 405ee6b..96a6d5d 100644
@@ -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);
 
Signature · 1 line
tg: (852b98c..) t/sectionfixes/pio (depends on: t/sectionfixes/h1940bt)
#1 lore raw

PATCH 1/1 Use platform_driver_probe for pdc platform driver

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.)

Cc Haavard Skinnemoen <[email protected]>
---
 arch/avr32/mach-at32ap/pdc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/avr32/mach-at32ap/pdc.c +1 -2
index 1040bda..61ab15a 100644
@@ -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);
Signature · 1 line
tg: (639920b..) t/sectionfixes/pdc (depends on: t/sectionfixes/pio)
#2 lore raw

Re: [PATCH] Use platform_driver_probe for pdc platform driver

Quoted 8 lines · Uwe Kleine-König

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.)

Applied both this and the pio one. Thanks!

Haavard