提交 20c225cb 编写于 作者: J Jingoo Han 提交者: Linus Torvalds

backlight: jornada720: use pr_err()/pr_info() instead of printk()

Use pr_err()/pr_info() 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_err(... to printk(KERN_ERR, ...
WARNING: Prefer pr_info(... to printk(KERN_INFO, ...

[akpm@linux-foundation.org: use KBUILD_MODNAME, per Joe]
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Acked-by: NKristoffer Ericson <kristoffer.ericson@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 8c7610f3
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/backlight.h> #include <linux/backlight.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/fb.h> #include <linux/fb.h>
...@@ -38,7 +40,7 @@ static int jornada_bl_get_brightness(struct backlight_device *bd) ...@@ -38,7 +40,7 @@ static int jornada_bl_get_brightness(struct backlight_device *bd)
ret = jornada_ssp_byte(GETBRIGHTNESS); ret = jornada_ssp_byte(GETBRIGHTNESS);
if (jornada_ssp_byte(GETBRIGHTNESS) != TXDUMMY) { if (jornada_ssp_byte(GETBRIGHTNESS) != TXDUMMY) {
printk(KERN_ERR "bl : get brightness timeout\n"); pr_err("get brightness timeout\n");
jornada_ssp_end(); jornada_ssp_end();
return -ETIMEDOUT; return -ETIMEDOUT;
} else /* exchange txdummy for value */ } else /* exchange txdummy for value */
...@@ -59,7 +61,7 @@ static int jornada_bl_update_status(struct backlight_device *bd) ...@@ -59,7 +61,7 @@ static int jornada_bl_update_status(struct backlight_device *bd)
if ((bd->props.power != FB_BLANK_UNBLANK) || (bd->props.fb_blank != FB_BLANK_UNBLANK)) { if ((bd->props.power != FB_BLANK_UNBLANK) || (bd->props.fb_blank != FB_BLANK_UNBLANK)) {
ret = jornada_ssp_byte(BRIGHTNESSOFF); ret = jornada_ssp_byte(BRIGHTNESSOFF);
if (ret != TXDUMMY) { if (ret != TXDUMMY) {
printk(KERN_INFO "bl : brightness off timeout\n"); pr_info("brightness off timeout\n");
/* turn off backlight */ /* turn off backlight */
PPSR &= ~PPC_LDD1; PPSR &= ~PPC_LDD1;
PPDR |= PPC_LDD1; PPDR |= PPC_LDD1;
...@@ -70,7 +72,7 @@ static int jornada_bl_update_status(struct backlight_device *bd) ...@@ -70,7 +72,7 @@ static int jornada_bl_update_status(struct backlight_device *bd)
/* send command to our mcu */ /* send command to our mcu */
if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) { if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
printk(KERN_INFO "bl : failed to set brightness\n"); pr_info("failed to set brightness\n");
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
goto out; goto out;
} }
...@@ -81,7 +83,7 @@ static int jornada_bl_update_status(struct backlight_device *bd) ...@@ -81,7 +83,7 @@ static int jornada_bl_update_status(struct backlight_device *bd)
but due to physical layout it is equal to 0, so we simply but due to physical layout it is equal to 0, so we simply
invert the value (MAX VALUE - NEW VALUE). */ invert the value (MAX VALUE - NEW VALUE). */
if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness) != TXDUMMY) { if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness) != TXDUMMY) {
printk(KERN_ERR "bl : set brightness failed\n"); pr_err("set brightness failed\n");
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
} }
...@@ -113,7 +115,7 @@ static int jornada_bl_probe(struct platform_device *pdev) ...@@ -113,7 +115,7 @@ static int jornada_bl_probe(struct platform_device *pdev)
if (IS_ERR(bd)) { if (IS_ERR(bd)) {
ret = PTR_ERR(bd); ret = PTR_ERR(bd);
printk(KERN_ERR "bl : failed to register device, err=%x\n", ret); pr_err("failed to register device, err=%x\n", ret);
return ret; return ret;
} }
...@@ -125,7 +127,7 @@ static int jornada_bl_probe(struct platform_device *pdev) ...@@ -125,7 +127,7 @@ static int jornada_bl_probe(struct platform_device *pdev)
jornada_bl_update_status(bd); jornada_bl_update_status(bd);
platform_set_drvdata(pdev, bd); platform_set_drvdata(pdev, bd);
printk(KERN_INFO "HP Jornada 700 series backlight driver\n"); pr_info("HP Jornada 700 series backlight driver\n");
return 0; return 0;
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/device.h> #include <linux/device.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -44,7 +46,7 @@ static int jornada_lcd_get_contrast(struct lcd_device *dev) ...@@ -44,7 +46,7 @@ static int jornada_lcd_get_contrast(struct lcd_device *dev)
jornada_ssp_start(); jornada_ssp_start();
if (jornada_ssp_byte(GETCONTRAST) != TXDUMMY) { if (jornada_ssp_byte(GETCONTRAST) != TXDUMMY) {
printk(KERN_ERR "lcd: get contrast failed\n"); pr_err("get contrast failed\n");
jornada_ssp_end(); jornada_ssp_end();
return -ETIMEDOUT; return -ETIMEDOUT;
} else { } else {
...@@ -65,7 +67,7 @@ static int jornada_lcd_set_contrast(struct lcd_device *dev, int value) ...@@ -65,7 +67,7 @@ static int jornada_lcd_set_contrast(struct lcd_device *dev, int value)
/* push the new value */ /* push the new value */
if (jornada_ssp_byte(value) != TXDUMMY) { if (jornada_ssp_byte(value) != TXDUMMY) {
printk(KERN_ERR "lcd : set contrast failed\n"); pr_err("set contrast failed\n");
jornada_ssp_end(); jornada_ssp_end();
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -103,7 +105,7 @@ static int jornada_lcd_probe(struct platform_device *pdev) ...@@ -103,7 +105,7 @@ static int jornada_lcd_probe(struct platform_device *pdev)
if (IS_ERR(lcd_device)) { if (IS_ERR(lcd_device)) {
ret = PTR_ERR(lcd_device); ret = PTR_ERR(lcd_device);
printk(KERN_ERR "lcd : failed to register device\n"); pr_err("failed to register device\n");
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册