summaryrefslogtreecommitdiff
path: root/drivers/watchdog/machzwd.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@sw.ru>2007-11-01 16:27:08 -0700
committerWim Van Sebroeck <wim@iguana.be>2007-11-02 19:09:07 +0000
commitc7dfd0cca300c5dc49213cf1c78c77393600410d (patch)
tree5a4a5ecb5ab0215113eacf763a9d15500a02b0ee /drivers/watchdog/machzwd.c
parent2ba7d7b39f3adf3f71aa3acab00111a429056c7d (diff)
[WATCHDOG] spin_lock_init() fixes
Some watchdog drivers initialize global spinlocks in module's init function which is tolerable, but some do it in PCI probe function. So, switch to static initialization to fix theoretical bugs and, more importantly, stop giving people bad examples. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/watchdog/machzwd.c')
-rw-r--r--drivers/watchdog/machzwd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 6d35bb112a5f..e6e07b4575eb 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -123,8 +123,8 @@ static void zf_ping(unsigned long data);
static int zf_action = GEN_RESET;
static unsigned long zf_is_open;
static char zf_expect_close;
-static spinlock_t zf_lock;
-static spinlock_t zf_port_lock;
+static DEFINE_SPINLOCK(zf_lock);
+static DEFINE_SPINLOCK(zf_port_lock);
static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
static unsigned long next_heartbeat = 0;
@@ -438,9 +438,6 @@ static int __init zf_init(void)
zf_show_action(action);
- spin_lock_init(&zf_lock);
- spin_lock_init(&zf_port_lock);
-
if(!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")){
printk(KERN_ERR "cannot reserve I/O ports at %d\n",
ZF_IOBASE);