Commit 593fc178 authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Wim Van Sebroeck

[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: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ab4ba3cd
...@@ -48,6 +48,7 @@ struct mpc8xxx_wdt_type { ...@@ -48,6 +48,7 @@ struct mpc8xxx_wdt_type {
}; };
static struct mpc8xxx_wdt __iomem *wd_base; static struct mpc8xxx_wdt __iomem *wd_base;
static int mpc8xxx_wdt_init_late(void);
static u16 timeout = 0xffff; static u16 timeout = 0xffff;
module_param(timeout, ushort, 0); module_param(timeout, ushort, 0);
...@@ -213,6 +214,12 @@ static int __devinit mpc8xxx_wdt_probe(struct of_device *ofdev, ...@@ -213,6 +214,12 @@ static int __devinit mpc8xxx_wdt_probe(struct of_device *ofdev,
else else
timeout_sec = timeout / freq; timeout_sec = timeout / freq;
#ifdef MODULE
ret = mpc8xxx_wdt_init_late();
if (ret)
goto err_unmap;
#endif
pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d " pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d "
"(%d seconds)\n", reset ? "reset" : "interrupt", timeout, "(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
timeout_sec); timeout_sec);
...@@ -280,7 +287,7 @@ static struct of_platform_driver mpc8xxx_wdt_driver = { ...@@ -280,7 +287,7 @@ static struct of_platform_driver mpc8xxx_wdt_driver = {
* very early to start pinging the watchdog (misc devices are not yet * very early to start pinging the watchdog (misc devices are not yet
* available), and later module_init() just registers the misc device. * available), and later module_init() just registers the misc device.
*/ */
static int __init mpc8xxx_wdt_init_late(void) static int mpc8xxx_wdt_init_late(void)
{ {
int ret; int ret;
...@@ -295,7 +302,9 @@ static int __init mpc8xxx_wdt_init_late(void) ...@@ -295,7 +302,9 @@ static int __init mpc8xxx_wdt_init_late(void)
} }
return 0; return 0;
} }
#ifndef MODULE
module_init(mpc8xxx_wdt_init_late); module_init(mpc8xxx_wdt_init_late);
#endif
static int __init mpc8xxx_wdt_init(void) static int __init mpc8xxx_wdt_init(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment