lkml.org 
[lkml]   [2008]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] pci: add pci_printk
Date
use DEFINE_LOGLEVEL_SETUP to set loglevel for pci

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
drivers/pci/pci.c | 7 +++++++
include/linux/pci.h | 6 ++++++
2 files changed, 13 insertions(+)

Index: linux-2.6/drivers/pci/pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci.c
+++ linux-2.6/drivers/pci/pci.c
@@ -1953,6 +1953,13 @@ static int __devinit pci_setup(char *str
}
early_param("pci", pci_setup);

+static void __init setup_loglevel_pci(char *str)
+{
+ get_option(&str, &loglevel_pci);
+}
+
+DEFINE_LOGLEVEL_SETUP(pci, "pci:", setup_loglevel_pci);
+
device_initcall_sync(pci_init);

EXPORT_SYMBOL(pci_reenable_device);
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -55,6 +55,12 @@
/* Include the ID list */
#include <linux/pci_ids.h>

+extern int loglevel_pci;
+#define pci_printk(v, s, a...) do { \
+ if ((v) <= loglevel_pci) \
+ printk(s, ##a); \
+ } while (0)
+
/* pci_slot represents a physical slot */
struct pci_slot {
struct pci_bus *bus; /* The bus this slot is on */

\
 
 \ /
  Last update: 2008-09-16 03:33    [W:0.055 / U:21.812 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site