diff options
Diffstat (limited to 'drivers/watchdog/of_xilinx_wdt.c')
-rw-r--r-- | drivers/watchdog/of_xilinx_wdt.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index f359ab85c3bc..55d2f66dbeae 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * know the wdt reset interval | 19 | * know the wdt reset interval |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/module.h> | 24 | #include <linux/module.h> |
23 | #include <linux/types.h> | 25 | #include <linux/types.h> |
24 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
@@ -99,7 +101,7 @@ static void xwdt_stop(void) | |||
99 | iowrite32(0, xdev.base + XWT_TWCSR1_OFFSET); | 101 | iowrite32(0, xdev.base + XWT_TWCSR1_OFFSET); |
100 | 102 | ||
101 | spin_unlock(&spinlock); | 103 | spin_unlock(&spinlock); |
102 | printk(KERN_INFO PFX "Stopped!\n"); | 104 | pr_info("Stopped!\n"); |
103 | } | 105 | } |
104 | 106 | ||
105 | static void xwdt_keepalive(void) | 107 | static void xwdt_keepalive(void) |
@@ -165,7 +167,7 @@ static int xwdt_open(struct inode *inode, struct file *file) | |||
165 | __module_get(THIS_MODULE); | 167 | __module_get(THIS_MODULE); |
166 | 168 | ||
167 | xwdt_start(); | 169 | xwdt_start(); |
168 | printk(KERN_INFO PFX "Started...\n"); | 170 | pr_info("Started...\n"); |
169 | 171 | ||
170 | return nonseekable_open(inode, file); | 172 | return nonseekable_open(inode, file); |
171 | } | 173 | } |
@@ -175,8 +177,7 @@ static int xwdt_release(struct inode *inode, struct file *file) | |||
175 | if (expect_close == 42) { | 177 | if (expect_close == 42) { |
176 | xwdt_stop(); | 178 | xwdt_stop(); |
177 | } else { | 179 | } else { |
178 | printk(KERN_CRIT PFX | 180 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
179 | "Unexpected close, not stopping watchdog!\n"); | ||
180 | xwdt_keepalive(); | 181 | xwdt_keepalive(); |
181 | } | 182 | } |
182 | 183 | ||
@@ -300,22 +301,20 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
300 | "clock-frequency", NULL); | 301 | "clock-frequency", NULL); |
301 | 302 | ||
302 | if (pfreq == NULL) { | 303 | if (pfreq == NULL) { |
303 | printk(KERN_WARNING PFX | 304 | pr_warn("The watchdog clock frequency cannot be obtained!\n"); |
304 | "The watchdog clock frequency cannot be obtained!\n"); | ||
305 | no_timeout = 1; | 305 | no_timeout = 1; |
306 | } | 306 | } |
307 | 307 | ||
308 | rc = of_address_to_resource(pdev->dev.of_node, 0, &xdev.res); | 308 | rc = of_address_to_resource(pdev->dev.of_node, 0, &xdev.res); |
309 | if (rc) { | 309 | if (rc) { |
310 | printk(KERN_WARNING PFX "invalid address!\n"); | 310 | pr_warn("invalid address!\n"); |
311 | return rc; | 311 | return rc; |
312 | } | 312 | } |
313 | 313 | ||
314 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, | 314 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, |
315 | "xlnx,wdt-interval", NULL); | 315 | "xlnx,wdt-interval", NULL); |
316 | if (tmptr == NULL) { | 316 | if (tmptr == NULL) { |
317 | printk(KERN_WARNING PFX "Parameter \"xlnx,wdt-interval\"" | 317 | pr_warn("Parameter \"xlnx,wdt-interval\" not found in device tree!\n"); |
318 | " not found in device tree!\n"); | ||
319 | no_timeout = 1; | 318 | no_timeout = 1; |
320 | } else { | 319 | } else { |
321 | xdev.wdt_interval = *tmptr; | 320 | xdev.wdt_interval = *tmptr; |
@@ -324,8 +323,7 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
324 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, | 323 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, |
325 | "xlnx,wdt-enable-once", NULL); | 324 | "xlnx,wdt-enable-once", NULL); |
326 | if (tmptr == NULL) { | 325 | if (tmptr == NULL) { |
327 | printk(KERN_WARNING PFX "Parameter \"xlnx,wdt-enable-once\"" | 326 | pr_warn("Parameter \"xlnx,wdt-enable-once\" not found in device tree!\n"); |
328 | " not found in device tree!\n"); | ||
329 | xdev.nowayout = WATCHDOG_NOWAYOUT; | 327 | xdev.nowayout = WATCHDOG_NOWAYOUT; |
330 | } | 328 | } |
331 | 329 | ||
@@ -339,20 +337,20 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
339 | if (!request_mem_region(xdev.res.start, | 337 | if (!request_mem_region(xdev.res.start, |
340 | xdev.res.end - xdev.res.start + 1, WATCHDOG_NAME)) { | 338 | xdev.res.end - xdev.res.start + 1, WATCHDOG_NAME)) { |
341 | rc = -ENXIO; | 339 | rc = -ENXIO; |
342 | printk(KERN_ERR PFX "memory request failure!\n"); | 340 | pr_err("memory request failure!\n"); |
343 | goto err_out; | 341 | goto err_out; |
344 | } | 342 | } |
345 | 343 | ||
346 | xdev.base = ioremap(xdev.res.start, xdev.res.end - xdev.res.start + 1); | 344 | xdev.base = ioremap(xdev.res.start, xdev.res.end - xdev.res.start + 1); |
347 | if (xdev.base == NULL) { | 345 | if (xdev.base == NULL) { |
348 | rc = -ENOMEM; | 346 | rc = -ENOMEM; |
349 | printk(KERN_ERR PFX "ioremap failure!\n"); | 347 | pr_err("ioremap failure!\n"); |
350 | goto release_mem; | 348 | goto release_mem; |
351 | } | 349 | } |
352 | 350 | ||
353 | rc = xwdt_selftest(); | 351 | rc = xwdt_selftest(); |
354 | if (rc == XWT_TIMER_FAILED) { | 352 | if (rc == XWT_TIMER_FAILED) { |
355 | printk(KERN_ERR PFX "SelfTest routine error!\n"); | 353 | pr_err("SelfTest routine error!\n"); |
356 | goto unmap_io; | 354 | goto unmap_io; |
357 | } | 355 | } |
358 | 356 | ||
@@ -360,20 +358,17 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
360 | 358 | ||
361 | rc = misc_register(&xwdt_miscdev); | 359 | rc = misc_register(&xwdt_miscdev); |
362 | if (rc) { | 360 | if (rc) { |
363 | printk(KERN_ERR PFX | 361 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
364 | "cannot register miscdev on minor=%d (err=%d)\n", | 362 | xwdt_miscdev.minor, rc); |
365 | xwdt_miscdev.minor, rc); | ||
366 | goto unmap_io; | 363 | goto unmap_io; |
367 | } | 364 | } |
368 | 365 | ||
369 | if (no_timeout) | 366 | if (no_timeout) |
370 | printk(KERN_INFO PFX | 367 | pr_info("driver loaded (timeout=? sec, nowayout=%d)\n", |
371 | "driver loaded (timeout=? sec, nowayout=%d)\n", | 368 | xdev.nowayout); |
372 | xdev.nowayout); | ||
373 | else | 369 | else |
374 | printk(KERN_INFO PFX | 370 | pr_info("driver loaded (timeout=%d sec, nowayout=%d)\n", |
375 | "driver loaded (timeout=%d sec, nowayout=%d)\n", | 371 | timeout, xdev.nowayout); |
376 | timeout, xdev.nowayout); | ||
377 | 372 | ||
378 | expect_close = 0; | 373 | expect_close = 0; |
379 | clear_bit(0, &driver_open); | 374 | clear_bit(0, &driver_open); |