aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-05-29 18:07:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 19:22:29 -0400
commit7b12c1b9ee6f66c12f9dc16f76474caa74dbc01f (patch)
tree55a36085b3dac5965d7e2684bacd762bea47930c /drivers
parent35f961623cee5212d4ee0baa8c34b1766913b36b (diff)
backlight: apple_bl: use pr_debug()/pr_err() instead of printk()
Use pr_debug()/pr_err() 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_debug(... to printk(KERN_DEBUG, ... WARNING: Prefer pr_err(... to printk(KERN_ERR, ... [akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Cc: Matthew Garrett <mjg@redhat.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')
-rw-r--r--drivers/video/backlight/apple_bl.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index ef5ca0d6cd2..9dc73ac3709 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -16,6 +16,8 @@
16 * get at the firmware code in order to figure out what it's actually doing. 16 * get at the firmware code in order to figure out what it's actually doing.
17 */ 17 */
18 18
19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20
19#include <linux/module.h> 21#include <linux/module.h>
20#include <linux/kernel.h> 22#include <linux/kernel.h>
21#include <linux/init.h> 23#include <linux/init.h>
@@ -40,8 +42,6 @@ struct hw_data {
40 42
41static const struct hw_data *hw_data; 43static const struct hw_data *hw_data;
42 44
43#define DRIVER "apple_backlight: "
44
45/* Module parameters. */ 45/* Module parameters. */
46static int debug; 46static int debug;
47module_param_named(debug, debug, int, 0644); 47module_param_named(debug, debug, int, 0644);
@@ -61,8 +61,7 @@ static int intel_chipset_send_intensity(struct backlight_device *bd)
61 int intensity = bd->props.brightness; 61 int intensity = bd->props.brightness;
62 62
63 if (debug) 63 if (debug)
64 printk(KERN_DEBUG DRIVER "setting brightness to %d\n", 64 pr_debug("setting brightness to %d\n", intensity);
65 intensity);
66 65
67 intel_chipset_set_brightness(intensity); 66 intel_chipset_set_brightness(intensity);
68 return 0; 67 return 0;
@@ -77,8 +76,7 @@ static int intel_chipset_get_intensity(struct backlight_device *bd)
77 intensity = inb(0xb3) >> 4; 76 intensity = inb(0xb3) >> 4;
78 77
79 if (debug) 78 if (debug)
80 printk(KERN_DEBUG DRIVER "read brightness of %d\n", 79 pr_debug("read brightness of %d\n", intensity);
81 intensity);
82 80
83 return intensity; 81 return intensity;
84} 82}
@@ -108,8 +106,7 @@ static int nvidia_chipset_send_intensity(struct backlight_device *bd)
108 int intensity = bd->props.brightness; 106 int intensity = bd->props.brightness;
109 107
110 if (debug) 108 if (debug)
111 printk(KERN_DEBUG DRIVER "setting brightness to %d\n", 109 pr_debug("setting brightness to %d\n", intensity);
112 intensity);
113 110
114 nvidia_chipset_set_brightness(intensity); 111 nvidia_chipset_set_brightness(intensity);
115 return 0; 112 return 0;
@@ -124,8 +121,7 @@ static int nvidia_chipset_get_intensity(struct backlight_device *bd)
124 intensity = inb(0x52f) >> 4; 121 intensity = inb(0x52f) >> 4;
125 122
126 if (debug) 123 if (debug)
127 printk(KERN_DEBUG DRIVER "read brightness of %d\n", 124 pr_debug("read brightness of %d\n", intensity);
128 intensity);
129 125
130 return intensity; 126 return intensity;
131} 127}
@@ -150,7 +146,7 @@ static int __devinit apple_bl_add(struct acpi_device *dev)
150 host = pci_get_bus_and_slot(0, 0); 146 host = pci_get_bus_and_slot(0, 0);
151 147
152 if (!host) { 148 if (!host) {
153 printk(KERN_ERR DRIVER "unable to find PCI host\n"); 149 pr_err("unable to find PCI host\n");
154 return -ENODEV; 150 return -ENODEV;
155 } 151 }
156 152
@@ -162,7 +158,7 @@ static int __devinit apple_bl_add(struct acpi_device *dev)
162 pci_dev_put(host); 158 pci_dev_put(host);
163 159
164 if (!hw_data) { 160 if (!hw_data) {
165 printk(KERN_ERR DRIVER "unknown hardware\n"); 161 pr_err("unknown hardware\n");
166 return -ENODEV; 162 return -ENODEV;
167 } 163 }
168 164