[PATCH v1 2/2] x86/PCI: make printks more informative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This updates printks so they have more context and look more like the
usual PCI stuff.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>
---
 arch/x86/pci/bus_numa.h  |    1 +
 arch/x86/pci/intel_bus.c |   17 +++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/x86/pci/bus_numa.h b/arch/x86/pci/bus_numa.h
index 4ff126a..17b73ee 100644
--- a/arch/x86/pci/bus_numa.h
+++ b/arch/x86/pci/bus_numa.h
@@ -7,6 +7,7 @@
  */
 #define RES_NUM 16
 struct pci_root_info {
+	struct pci_dev *dev;
 	char name[12];
 	unsigned int res_num;
 	struct resource res[RES_NUM];
diff --git a/arch/x86/pci/intel_bus.c b/arch/x86/pci/intel_bus.c
index b7a55dc..739b330 100644
--- a/arch/x86/pci/intel_bus.c
+++ b/arch/x86/pci/intel_bus.c
@@ -12,23 +12,22 @@
 
 static inline void print_ioh_resources(struct pci_root_info *info)
 {
+	struct pci_dev *dev = info->dev;
 	int res_num;
 	int busnum;
 	int i;
 
-	printk(KERN_DEBUG "IOH bus: [%02x, %02x]\n",
-			info->bus_min, info->bus_max);
+	dev_info(&dev->dev, "Intel IOH host bridge to [bus %02x-%02x]\n",
+		   info->bus_min, info->bus_max);
 	res_num = info->res_num;
 	busnum = info->bus_min;
 	for (i = 0; i < res_num; i++) {
 		struct resource *res;
 
 		res = &info->res[i];
-		printk(KERN_DEBUG "IOH bus: %02x index %x %s: [%llx, %llx]\n",
-			busnum, i,
-			(res->flags & IORESOURCE_IO) ? "io port" :
-							"mmio",
-			res->start, res->end);
+		dev_printk(KERN_DEBUG, &dev->dev,
+			   "host bridge window %pR to [bus %02x-%02x]\n", res,
+			   info->bus_min, info->bus_max);
 	}
 }
 
@@ -50,13 +49,15 @@ static void __devinit pci_root_bus_res(struct pci_dev *dev)
 	int bus_base, bus_end;
 
 	if (pci_root_num >= PCI_ROOT_NR) {
-		printk(KERN_DEBUG "intel_bus.c: PCI_ROOT_NR is too small\n");
+		dev_warn(&dev->dev, "intel_bus.c: PCI_ROOT_NR is too small\n");
 		return;
 	}
 
 	info = &pci_root_info[pci_root_num];
 	pci_root_num++;
 
+	info->dev = dev;
+
 	pci_read_config_word(dev, IOH_LCFGBUS, &word);
 	bus_base = (word & 0xff);
 	bus_end = (word & 0xff00) >> 8;

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux