aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2009-03-27 19:26:26 -0400
committerWim Van Sebroeck <wim@iguana.be>2009-04-08 02:12:46 -0400
commit47dec7c6c48a12bdacdf5f935f10f44e66d9c98c (patch)
treec10c8e2edcdda58e4a9029b4fd316798fe33a2a7
parentb8f75b0d79671cb53d94e4ddd1db89502a7dc90e (diff)
[WATCHDOG] at91rm9200_wdt.c: move probe function to .devinit.text
A pointer to at91wdt_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Andrew Victor <linux@maxim.org.za> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Ilpo Jarvinen <ilpo.jarvinen@helsinki.fi> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r--drivers/watchdog/at91rm9200_wdt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c
index e35d54589232..29e52c237a3b 100644
--- a/drivers/watchdog/at91rm9200_wdt.c
+++ b/drivers/watchdog/at91rm9200_wdt.c
@@ -197,7 +197,7 @@ static struct miscdevice at91wdt_miscdev = {
197 .fops = &at91wdt_fops, 197 .fops = &at91wdt_fops,
198}; 198};
199 199
200static int __init at91wdt_probe(struct platform_device *pdev) 200static int __devinit at91wdt_probe(struct platform_device *pdev)
201{ 201{
202 int res; 202 int res;
203 203
@@ -214,7 +214,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
214 return 0; 214 return 0;
215} 215}
216 216
217static int __exit at91wdt_remove(struct platform_device *pdev) 217static int __devexit at91wdt_remove(struct platform_device *pdev)
218{ 218{
219 int res; 219 int res;
220 220
@@ -252,7 +252,7 @@ static int at91wdt_resume(struct platform_device *pdev)
252 252
253static struct platform_driver at91wdt_driver = { 253static struct platform_driver at91wdt_driver = {
254 .probe = at91wdt_probe, 254 .probe = at91wdt_probe,
255 .remove = __exit_p(at91wdt_remove), 255 .remove = __devexit_p(at91wdt_remove),
256 .shutdown = at91wdt_shutdown, 256 .shutdown = at91wdt_shutdown,
257 .suspend = at91wdt_suspend, 257 .suspend = at91wdt_suspend,
258 .resume = at91wdt_resume, 258 .resume = at91wdt_resume,