diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-05-29 18:07:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:29 -0400 |
commit | 35f961623cee5212d4ee0baa8c34b1766913b36b (patch) | |
tree | a68358ec16195a57273cd22595368b3b3850864b /drivers/video/backlight/backlight.c | |
parent | 71d7225cd4275e7fd7003dd6ec42320905eacc7d (diff) |
backlight: use pr_warn() and pr_debug() instead of printk()
Use pr_warn() and pr_debug() instead of printk to allow dynamic debugging.
The pr_fmt prefix for pr_ macros is used. Also fix checkpatch warnings
as below:
WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
[akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight/backlight.c')
-rw-r--r-- | drivers/video/backlight/backlight.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index bf5b1ece7160..297db2fa91f5 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * | 5 | * |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
9 | |||
8 | #include <linux/module.h> | 10 | #include <linux/module.h> |
9 | #include <linux/init.h> | 11 | #include <linux/init.h> |
10 | #include <linux/device.h> | 12 | #include <linux/device.h> |
@@ -123,7 +125,7 @@ static ssize_t backlight_store_power(struct device *dev, | |||
123 | rc = -ENXIO; | 125 | rc = -ENXIO; |
124 | mutex_lock(&bd->ops_lock); | 126 | mutex_lock(&bd->ops_lock); |
125 | if (bd->ops) { | 127 | if (bd->ops) { |
126 | pr_debug("backlight: set power to %lu\n", power); | 128 | pr_debug("set power to %lu\n", power); |
127 | if (bd->props.power != power) { | 129 | if (bd->props.power != power) { |
128 | bd->props.power = power; | 130 | bd->props.power = power; |
129 | backlight_update_status(bd); | 131 | backlight_update_status(bd); |
@@ -161,8 +163,7 @@ static ssize_t backlight_store_brightness(struct device *dev, | |||
161 | if (brightness > bd->props.max_brightness) | 163 | if (brightness > bd->props.max_brightness) |
162 | rc = -EINVAL; | 164 | rc = -EINVAL; |
163 | else { | 165 | else { |
164 | pr_debug("backlight: set brightness to %lu\n", | 166 | pr_debug("set brightness to %lu\n", brightness); |
165 | brightness); | ||
166 | bd->props.brightness = brightness; | 167 | bd->props.brightness = brightness; |
167 | backlight_update_status(bd); | 168 | backlight_update_status(bd); |
168 | rc = count; | 169 | rc = count; |
@@ -378,8 +379,8 @@ static int __init backlight_class_init(void) | |||
378 | { | 379 | { |
379 | backlight_class = class_create(THIS_MODULE, "backlight"); | 380 | backlight_class = class_create(THIS_MODULE, "backlight"); |
380 | if (IS_ERR(backlight_class)) { | 381 | if (IS_ERR(backlight_class)) { |
381 | printk(KERN_WARNING "Unable to create backlight class; errno = %ld\n", | 382 | pr_warn("Unable to create backlight class; errno = %ld\n", |
382 | PTR_ERR(backlight_class)); | 383 | PTR_ERR(backlight_class)); |
383 | return PTR_ERR(backlight_class); | 384 | return PTR_ERR(backlight_class); |
384 | } | 385 | } |
385 | 386 | ||