[PATCH 7/7] pci: add KERN_PCI

Yinghai Lu
2008-09-18T00:25:45Z

use DEFINE_LOGLEVEL_SETUP to set loglevel for dev

so could use loglevel=4,dev:8 it will only print out info with dev_printk

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
drivers/base/core.c | 2 ++
include/linux/device.h | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/base/core.c
===================================================================
--- linux-2.6.orig/drivers/base/core.c
+++ linux-2.6/drivers/base/core.c
@@ -26,6 +26,8 @@
#include "base.h"
#include "power/power.h"

+DEFINE_LOGLEVEL_SETUP(dev, KERN_DEV, "dev:");
+
int (*platform_notify)(struct device *dev) = NULL;
int (*platform_notify_remove)(struct device *dev) = NULL;
static struct kobject *dev_kobj;
Index: linux-2.6/include/linux/device.h
===================================================================
--- linux-2.6.orig/include/linux/device.h
+++ linux-2.6/include/linux/device.h
@@ -518,10 +518,12 @@ extern void device_shutdown(void);
/* drivers/base/sys.c */
extern void sysdev_shutdown(void);

+#define KERN_DEV "<dev>"
+
/* debugging and troubleshooting/diagnostic helpers. */
extern const char *dev_driver_string(const struct device *dev);
#define dev_printk(level, dev, format, arg...) \
- printk(level "%s %s: " format , dev_driver_string(dev) , \
+ printk(level KERN_DEV "%s %s: " format , dev_driver_string(dev) , \
dev_name(dev) , ## arg)

#define dev_emerg(dev, format, arg...) \
@@ -538,6 +540,8 @@ extern const char *dev_driver_string(con
dev_printk(KERN_NOTICE , dev , format , ## arg)
#define dev_info(dev, format, arg...) \
dev_printk(KERN_INFO , dev , format , ## arg)
+#define dev_debug(dev, format, arg...) \
+ dev_printk(KERN_DEBUG , dev , format , ## arg)

#ifdef DEBUG
#define dev_dbg(dev, format, arg...) \