aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-02-21 19:45:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:29 -0500
commitc100a5e0255777c783646791e98434f300a94c4c (patch)
treea3de1d1a54232faf7f21a43300da8fd6727e16e5
parent0cc0c38e91392d2da769c9831739df43787d99e3 (diff)
rtc: use dev_warn()/dev_dbg()/pr_err() instead of printk()
Fix the checkpatch warning as below: WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rtc/class.c4
-rw-r--r--drivers/rtc/rtc-dev.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 26388f182594..9b742d3ffb94 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -11,6 +11,8 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15
14#include <linux/module.h> 16#include <linux/module.h>
15#include <linux/rtc.h> 17#include <linux/rtc.h>
16#include <linux/kdev_t.h> 18#include <linux/kdev_t.h>
@@ -261,7 +263,7 @@ static int __init rtc_init(void)
261{ 263{
262 rtc_class = class_create(THIS_MODULE, "rtc"); 264 rtc_class = class_create(THIS_MODULE, "rtc");
263 if (IS_ERR(rtc_class)) { 265 if (IS_ERR(rtc_class)) {
264 printk(KERN_ERR "%s: couldn't create class\n", __FILE__); 266 pr_err("couldn't create class\n");
265 return PTR_ERR(rtc_class); 267 return PTR_ERR(rtc_class);
266 } 268 }
267 rtc_class->suspend = rtc_suspend; 269 rtc_class->suspend = rtc_suspend;
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 9a86b4bd8699..d04939369251 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -11,6 +11,8 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15
14#include <linux/module.h> 16#include <linux/module.h>
15#include <linux/rtc.h> 17#include <linux/rtc.h>
16#include <linux/sched.h> 18#include <linux/sched.h>
@@ -462,7 +464,7 @@ void rtc_dev_prepare(struct rtc_device *rtc)
462 return; 464 return;
463 465
464 if (rtc->id >= RTC_DEV_MAX) { 466 if (rtc->id >= RTC_DEV_MAX) {
465 pr_debug("%s: too many RTC devices\n", rtc->name); 467 dev_dbg(&rtc->dev, "%s: too many RTC devices\n", rtc->name);
466 return; 468 return;
467 } 469 }
468 470
@@ -480,10 +482,10 @@ void rtc_dev_prepare(struct rtc_device *rtc)
480void rtc_dev_add_device(struct rtc_device *rtc) 482void rtc_dev_add_device(struct rtc_device *rtc)
481{ 483{
482 if (cdev_add(&rtc->char_dev, rtc->dev.devt, 1)) 484 if (cdev_add(&rtc->char_dev, rtc->dev.devt, 1))
483 printk(KERN_WARNING "%s: failed to add char device %d:%d\n", 485 dev_warn(&rtc->dev, "%s: failed to add char device %d:%d\n",
484 rtc->name, MAJOR(rtc_devt), rtc->id); 486 rtc->name, MAJOR(rtc_devt), rtc->id);
485 else 487 else
486 pr_debug("%s: dev (%d:%d)\n", rtc->name, 488 dev_dbg(&rtc->dev, "%s: dev (%d:%d)\n", rtc->name,
487 MAJOR(rtc_devt), rtc->id); 489 MAJOR(rtc_devt), rtc->id);
488} 490}
489 491
@@ -499,8 +501,7 @@ void __init rtc_dev_init(void)
499 501
500 err = alloc_chrdev_region(&rtc_devt, 0, RTC_DEV_MAX, "rtc"); 502 err = alloc_chrdev_region(&rtc_devt, 0, RTC_DEV_MAX, "rtc");
501 if (err < 0) 503 if (err < 0)
502 printk(KERN_ERR "%s: failed to allocate char dev region\n", 504 pr_err("failed to allocate char dev region\n");
503 __FILE__);
504} 505}
505 506
506void __exit rtc_dev_exit(void) 507void __exit rtc_dev_exit(void)