diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-08-20 19:38:36 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-08-26 16:20:44 -0400 |
commit | 593fc178f634b742d03660a35fcb5694c0751718 (patch) | |
tree | fa0ac9b0431b6de5f62b93495c8ff49d3cdbc4d8 /drivers/watchdog | |
parent | ab4ba3cdeb59e85552422680b5bac99e28740330 (diff) |
[WATCHDOG] mpc8xxx_wdt: fix modular build
Fix the following build error when mpc8xxx_wdt is selected to build as a
module:
drivers/watchdog/mpc8xxx_wdt.c:304: error: redefinition of '__inittest'
drivers/watchdog/mpc8xxx_wdt.c:298: error: previous definition of '__inittest' was here
drivers/watchdog/mpc8xxx_wdt.c:304: error: redefinition of 'init_module'
drivers/watchdog/mpc8xxx_wdt.c:298: error: previous definition of 'init_module' was here
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
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 f2094960e66..38c588ee694 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 | { |