aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sbc_epx_c3.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-04-12 13:49:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 13:49:28 -0400
commit8065248069097dddf9945acfb2081025e9618c16 (patch)
treeeddf3fb0372ba0f65c01382d386942ea8d18932d /drivers/watchdog/sbc_epx_c3.c
parente66a8ddff72e85605f2212a0ebc666c7e9116641 (diff)
parentb4838d12e1f3cb48c2489a0b08733b5dbf848297 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'drivers/watchdog/sbc_epx_c3.c')
-rw-r--r--drivers/watchdog/sbc_epx_c3.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/watchdog/sbc_epx_c3.c b/drivers/watchdog/sbc_epx_c3.c
index eaca366b7234..0c3e9f66ef77 100644
--- a/drivers/watchdog/sbc_epx_c3.c
+++ b/drivers/watchdog/sbc_epx_c3.c
@@ -13,6 +13,8 @@
13 * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> 13 * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk>
14 */ 14 */
15 15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
16#include <linux/module.h> 18#include <linux/module.h>
17#include <linux/moduleparam.h> 19#include <linux/moduleparam.h>
18#include <linux/types.h> 20#include <linux/types.h>
@@ -28,13 +30,12 @@
28#include <linux/uaccess.h> 30#include <linux/uaccess.h>
29#include <linux/io.h> 31#include <linux/io.h>
30 32
31#define PFX "epx_c3: "
32static int epx_c3_alive; 33static int epx_c3_alive;
33 34
34#define WATCHDOG_TIMEOUT 1 /* 1 sec default timeout */ 35#define WATCHDOG_TIMEOUT 1 /* 1 sec default timeout */
35 36
36static int nowayout = WATCHDOG_NOWAYOUT; 37static bool nowayout = WATCHDOG_NOWAYOUT;
37module_param(nowayout, int, 0); 38module_param(nowayout, bool, 0);
38MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" 39MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
39 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 40 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
40 41
@@ -51,7 +52,7 @@ static void epx_c3_stop(void)
51 52
52 outb(0, EPXC3_WATCHDOG_CTL_REG); 53 outb(0, EPXC3_WATCHDOG_CTL_REG);
53 54
54 printk(KERN_INFO PFX "Stopped watchdog timer.\n"); 55 pr_info("Stopped watchdog timer\n");
55} 56}
56 57
57static void epx_c3_pet(void) 58static void epx_c3_pet(void)
@@ -75,7 +76,7 @@ static int epx_c3_open(struct inode *inode, struct file *file)
75 epx_c3_pet(); 76 epx_c3_pet();
76 77
77 epx_c3_alive = 1; 78 epx_c3_alive = 1;
78 printk(KERN_INFO "Started watchdog timer.\n"); 79 pr_info("Started watchdog timer\n");
79 80
80 return nonseekable_open(inode, file); 81 return nonseekable_open(inode, file);
81} 82}
@@ -173,9 +174,6 @@ static struct notifier_block epx_c3_notifier = {
173 .notifier_call = epx_c3_notify_sys, 174 .notifier_call = epx_c3_notify_sys,
174}; 175};
175 176
176static const char banner[] __initconst = KERN_INFO PFX
177 "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n";
178
179static int __init watchdog_init(void) 177static int __init watchdog_init(void)
180{ 178{
181 int ret; 179 int ret;
@@ -185,20 +183,19 @@ static int __init watchdog_init(void)
185 183
186 ret = register_reboot_notifier(&epx_c3_notifier); 184 ret = register_reboot_notifier(&epx_c3_notifier);
187 if (ret) { 185 if (ret) {
188 printk(KERN_ERR PFX "cannot register reboot notifier " 186 pr_err("cannot register reboot notifier (err=%d)\n", ret);
189 "(err=%d)\n", ret);
190 goto out; 187 goto out;
191 } 188 }
192 189
193 ret = misc_register(&epx_c3_miscdev); 190 ret = misc_register(&epx_c3_miscdev);
194 if (ret) { 191 if (ret) {
195 printk(KERN_ERR PFX "cannot register miscdev on minor=%d " 192 pr_err("cannot register miscdev on minor=%d (err=%d)\n",
196 "(err=%d)\n", WATCHDOG_MINOR, ret); 193 WATCHDOG_MINOR, ret);
197 unregister_reboot_notifier(&epx_c3_notifier); 194 unregister_reboot_notifier(&epx_c3_notifier);
198 goto out; 195 goto out;
199 } 196 }
200 197
201 printk(banner); 198 pr_info("Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n");
202 199
203 return 0; 200 return 0;
204 201