* [PATCH v3 3/7] backlight: cr_bllcd: use pr_err/info instead of printk
@ 2012-05-16 8:09 Jingoo Han
2012-05-16 15:14 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2012-05-16 8:09 UTC (permalink / raw)
To: 'Andrew Morton', 'LKML'
Cc: 'Richard Purdie', 'Jingoo Han'
This patch uses pr_err/info instead of printk to allow dynamic debugging.
The pr_fmt prefix for pr_ macros is used. It also fixes checkpatch
warnings as below:
WARNING: printk() should include KERN_ facility level
WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/backlight/cr_bllcd.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c
index 22489eb..37bae80 100644
--- a/drivers/video/backlight/cr_bllcd.c
+++ b/drivers/video/backlight/cr_bllcd.c
@@ -27,6 +27,8 @@
* Alan Hourihane <alanh-at-tungstengraphics-dot-com>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -180,14 +182,13 @@ static int cr_backlight_probe(struct platform_device *pdev)
lpc_dev = pci_get_device(PCI_VENDOR_ID_INTEL,
CRVML_DEVICE_LPC, NULL);
if (!lpc_dev) {
- printk("INTEL CARILLO RANCH LPC not found.\n");
+ pr_err("INTEL CARILLO RANCH LPC not found.\n");
return -ENODEV;
}
pci_read_config_byte(lpc_dev, CRVML_REG_GPIOEN, &dev_en);
if (!(dev_en & CRVML_GPIOEN_BIT)) {
- printk(KERN_ERR
- "Carillo Ranch GPIO device was not enabled.\n");
+ pr_err("Carillo Ranch GPIO device was not enabled.\n");
pci_dev_put(lpc_dev);
return -ENODEV;
}
@@ -270,7 +271,7 @@ static int __init cr_backlight_init(void)
return PTR_ERR(crp);
}
- printk("Carillo Ranch Backlight Driver Initialized.\n");
+ pr_info("Carillo Ranch Backlight Driver Initialized.\n");
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3 3/7] backlight: cr_bllcd: use pr_err/info instead of printk
2012-05-16 8:09 [PATCH v3 3/7] backlight: cr_bllcd: use pr_err/info instead of printk Jingoo Han
@ 2012-05-16 15:14 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2012-05-16 15:14 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Andrew Morton', 'LKML', 'Richard Purdie'
On Wed, 2012-05-16 at 17:09 +0900, Jingoo Han wrote:
> This patch uses pr_err/info instead of printk to allow dynamic debugging.
Hi again.
pr_debug, dev_dbg and netdev_dbg are the only things
that can use dynamic debugging.
All the other levels are just normal logging mechanisms.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-16 15:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-16 8:09 [PATCH v3 3/7] backlight: cr_bllcd: use pr_err/info instead of printk Jingoo Han
2012-05-16 15:14 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).