diff options
Diffstat (limited to 'drivers/watchdog/indydog.c')
-rw-r--r-- | drivers/watchdog/indydog.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c index 1475e09f9af2..6d90f7a2ce22 100644 --- a/drivers/watchdog/indydog.c +++ b/drivers/watchdog/indydog.c | |||
@@ -12,6 +12,8 @@ | |||
12 | * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> | 12 | * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
16 | |||
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/moduleparam.h> | 18 | #include <linux/moduleparam.h> |
17 | #include <linux/types.h> | 19 | #include <linux/types.h> |
@@ -26,14 +28,13 @@ | |||
26 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
27 | #include <asm/sgi/mc.h> | 29 | #include <asm/sgi/mc.h> |
28 | 30 | ||
29 | #define PFX "indydog: " | ||
30 | static unsigned long indydog_alive; | 31 | static unsigned long indydog_alive; |
31 | static DEFINE_SPINLOCK(indydog_lock); | 32 | static DEFINE_SPINLOCK(indydog_lock); |
32 | 33 | ||
33 | #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ | 34 | #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ |
34 | 35 | ||
35 | static int nowayout = WATCHDOG_NOWAYOUT; | 36 | static bool nowayout = WATCHDOG_NOWAYOUT; |
36 | module_param(nowayout, int, 0); | 37 | module_param(nowayout, bool, 0); |
37 | MODULE_PARM_DESC(nowayout, | 38 | MODULE_PARM_DESC(nowayout, |
38 | "Watchdog cannot be stopped once started (default=" | 39 | "Watchdog cannot be stopped once started (default=" |
39 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 40 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
@@ -60,7 +61,7 @@ static void indydog_stop(void) | |||
60 | sgimc->cpuctrl0 = mc_ctrl0; | 61 | sgimc->cpuctrl0 = mc_ctrl0; |
61 | spin_unlock(&indydog_lock); | 62 | spin_unlock(&indydog_lock); |
62 | 63 | ||
63 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 64 | pr_info("Stopped watchdog timer\n"); |
64 | } | 65 | } |
65 | 66 | ||
66 | static void indydog_ping(void) | 67 | static void indydog_ping(void) |
@@ -83,7 +84,7 @@ static int indydog_open(struct inode *inode, struct file *file) | |||
83 | indydog_start(); | 84 | indydog_start(); |
84 | indydog_ping(); | 85 | indydog_ping(); |
85 | 86 | ||
86 | printk(KERN_INFO "Started watchdog timer.\n"); | 87 | pr_info("Started watchdog timer\n"); |
87 | 88 | ||
88 | return nonseekable_open(inode, file); | 89 | return nonseekable_open(inode, file); |
89 | } | 90 | } |
@@ -178,30 +179,25 @@ static struct notifier_block indydog_notifier = { | |||
178 | .notifier_call = indydog_notify_sys, | 179 | .notifier_call = indydog_notify_sys, |
179 | }; | 180 | }; |
180 | 181 | ||
181 | static char banner[] __initdata = | ||
182 | KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n"; | ||
183 | |||
184 | static int __init watchdog_init(void) | 182 | static int __init watchdog_init(void) |
185 | { | 183 | { |
186 | int ret; | 184 | int ret; |
187 | 185 | ||
188 | ret = register_reboot_notifier(&indydog_notifier); | 186 | ret = register_reboot_notifier(&indydog_notifier); |
189 | if (ret) { | 187 | if (ret) { |
190 | printk(KERN_ERR PFX | 188 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
191 | "cannot register reboot notifier (err=%d)\n", ret); | ||
192 | return ret; | 189 | return ret; |
193 | } | 190 | } |
194 | 191 | ||
195 | ret = misc_register(&indydog_miscdev); | 192 | ret = misc_register(&indydog_miscdev); |
196 | if (ret) { | 193 | if (ret) { |
197 | printk(KERN_ERR PFX | 194 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
198 | "cannot register miscdev on minor=%d (err=%d)\n", | 195 | WATCHDOG_MINOR, ret); |
199 | WATCHDOG_MINOR, ret); | ||
200 | unregister_reboot_notifier(&indydog_notifier); | 196 | unregister_reboot_notifier(&indydog_notifier); |
201 | return ret; | 197 | return ret; |
202 | } | 198 | } |
203 | 199 | ||
204 | printk(banner); | 200 | pr_info("Hardware Watchdog Timer for SGI IP22: 0.3\n"); |
205 | 201 | ||
206 | return 0; | 202 | return 0; |
207 | } | 203 | } |