Commit 7b12c1b9 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

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: default avatarJingoo 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 35f96162
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
* get at the firmware code in order to figure out what it's actually doing. * get at the firmware code in order to figure out what it's actually doing.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -40,8 +42,6 @@ struct hw_data { ...@@ -40,8 +42,6 @@ struct hw_data {
static const struct hw_data *hw_data; static const struct hw_data *hw_data;
#define DRIVER "apple_backlight: "
/* Module parameters. */ /* Module parameters. */
static int debug; static int debug;
module_param_named(debug, debug, int, 0644); module_param_named(debug, debug, int, 0644);
...@@ -61,8 +61,7 @@ static int intel_chipset_send_intensity(struct backlight_device *bd) ...@@ -61,8 +61,7 @@ static int intel_chipset_send_intensity(struct backlight_device *bd)
int intensity = bd->props.brightness; int intensity = bd->props.brightness;
if (debug) if (debug)
printk(KERN_DEBUG DRIVER "setting brightness to %d\n", pr_debug("setting brightness to %d\n", intensity);
intensity);
intel_chipset_set_brightness(intensity); intel_chipset_set_brightness(intensity);
return 0; return 0;
...@@ -77,8 +76,7 @@ static int intel_chipset_get_intensity(struct backlight_device *bd) ...@@ -77,8 +76,7 @@ static int intel_chipset_get_intensity(struct backlight_device *bd)
intensity = inb(0xb3) >> 4; intensity = inb(0xb3) >> 4;
if (debug) if (debug)
printk(KERN_DEBUG DRIVER "read brightness of %d\n", pr_debug("read brightness of %d\n", intensity);
intensity);
return intensity; return intensity;
} }
...@@ -108,8 +106,7 @@ static int nvidia_chipset_send_intensity(struct backlight_device *bd) ...@@ -108,8 +106,7 @@ static int nvidia_chipset_send_intensity(struct backlight_device *bd)
int intensity = bd->props.brightness; int intensity = bd->props.brightness;
if (debug) if (debug)
printk(KERN_DEBUG DRIVER "setting brightness to %d\n", pr_debug("setting brightness to %d\n", intensity);
intensity);
nvidia_chipset_set_brightness(intensity); nvidia_chipset_set_brightness(intensity);
return 0; return 0;
...@@ -124,8 +121,7 @@ static int nvidia_chipset_get_intensity(struct backlight_device *bd) ...@@ -124,8 +121,7 @@ static int nvidia_chipset_get_intensity(struct backlight_device *bd)
intensity = inb(0x52f) >> 4; intensity = inb(0x52f) >> 4;
if (debug) if (debug)
printk(KERN_DEBUG DRIVER "read brightness of %d\n", pr_debug("read brightness of %d\n", intensity);
intensity);
return intensity; return intensity;
} }
...@@ -150,7 +146,7 @@ static int __devinit apple_bl_add(struct acpi_device *dev) ...@@ -150,7 +146,7 @@ static int __devinit apple_bl_add(struct acpi_device *dev)
host = pci_get_bus_and_slot(0, 0); host = pci_get_bus_and_slot(0, 0);
if (!host) { if (!host) {
printk(KERN_ERR DRIVER "unable to find PCI host\n"); pr_err("unable to find PCI host\n");
return -ENODEV; return -ENODEV;
} }
...@@ -162,7 +158,7 @@ static int __devinit apple_bl_add(struct acpi_device *dev) ...@@ -162,7 +158,7 @@ static int __devinit apple_bl_add(struct acpi_device *dev)
pci_dev_put(host); pci_dev_put(host);
if (!hw_data) { if (!hw_data) {
printk(KERN_ERR DRIVER "unknown hardware\n"); pr_err("unknown hardware\n");
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment