diff options
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/mpc8xxx_wdt.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index f2094960e662..38c588ee694f 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c | |||
@@ -48,6 +48,7 @@ struct mpc8xxx_wdt_type { | |||
48 | }; | 48 | }; |
49 | 49 | ||
50 | static struct mpc8xxx_wdt __iomem *wd_base; | 50 | static struct mpc8xxx_wdt __iomem *wd_base; |
51 | static int mpc8xxx_wdt_init_late(void); | ||
51 | 52 | ||
52 | static u16 timeout = 0xffff; | 53 | static u16 timeout = 0xffff; |
53 | module_param(timeout, ushort, 0); | 54 | module_param(timeout, ushort, 0); |
@@ -213,6 +214,12 @@ static int __devinit mpc8xxx_wdt_probe(struct of_device *ofdev, | |||
213 | else | 214 | else |
214 | timeout_sec = timeout / freq; | 215 | timeout_sec = timeout / freq; |
215 | 216 | ||
217 | #ifdef MODULE | ||
218 | ret = mpc8xxx_wdt_init_late(); | ||
219 | if (ret) | ||
220 | goto err_unmap; | ||
221 | #endif | ||
222 | |||
216 | pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d " | 223 | pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d " |
217 | "(%d seconds)\n", reset ? "reset" : "interrupt", timeout, | 224 | "(%d seconds)\n", reset ? "reset" : "interrupt", timeout, |
218 | timeout_sec); | 225 | timeout_sec); |
@@ -280,7 +287,7 @@ static struct of_platform_driver mpc8xxx_wdt_driver = { | |||
280 | * very early to start pinging the watchdog (misc devices are not yet | 287 | * very early to start pinging the watchdog (misc devices are not yet |
281 | * available), and later module_init() just registers the misc device. | 288 | * available), and later module_init() just registers the misc device. |
282 | */ | 289 | */ |
283 | static int __init mpc8xxx_wdt_init_late(void) | 290 | static int mpc8xxx_wdt_init_late(void) |
284 | { | 291 | { |
285 | int ret; | 292 | int ret; |
286 | 293 | ||
@@ -295,7 +302,9 @@ static int __init mpc8xxx_wdt_init_late(void) | |||
295 | } | 302 | } |
296 | return 0; | 303 | return 0; |
297 | } | 304 | } |
305 | #ifndef MODULE | ||
298 | module_init(mpc8xxx_wdt_init_late); | 306 | module_init(mpc8xxx_wdt_init_late); |
307 | #endif | ||
299 | 308 | ||
300 | static int __init mpc8xxx_wdt_init(void) | 309 | static int __init mpc8xxx_wdt_init(void) |
301 | { | 310 | { |