Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: enhance physical slot debug information

Convert usages of pr_debug to dev_dbg and add physical slot name.

Note that we use dev_dbg on the struct pci_bus and still manually
print out the PCI slot number (instead of calling dev_dbg on a
pci_dev) because a struct pci_bus with empty physical slots will
not have any pci_devs.

Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Alex Chiang and committed by
Jesse Barnes
62795041 6a82e218

+8 -10
+8 -10
drivers/pci/slot.c
··· 1 1 /* 2 2 * drivers/pci/slot.c 3 3 * Copyright (C) 2006 Matthew Wilcox <matthew@wil.cx> 4 - * Copyright (C) 2006-2008 Hewlett-Packard Development Company, L.P. 5 - * Alex Chiang <achiang@hp.com> 4 + * Copyright (C) 2006-2009 Hewlett-Packard Development Company, L.P. 5 + * Alex Chiang <achiang@hp.com> 6 6 */ 7 7 8 8 #include <linux/kobject.h> ··· 52 52 struct pci_dev *dev; 53 53 struct pci_slot *slot = to_pci_slot(kobj); 54 54 55 - pr_debug("%s: releasing pci_slot on %x:%d\n", __func__, 56 - slot->bus->number, slot->number); 55 + dev_dbg(&slot->bus->dev, "dev %02x, released physical slot %s\n", 56 + slot->number, pci_slot_name(slot)); 57 57 58 58 list_for_each_entry(dev, &slot->bus->devices, bus_list) 59 59 if (PCI_SLOT(dev->devfn) == slot->number) ··· 248 248 if (PCI_SLOT(dev->devfn) == slot_nr) 249 249 dev->slot = slot; 250 250 251 - /* Don't care if debug printk has a -1 for slot_nr */ 252 - pr_debug("%s: created pci_slot on %04x:%02x:%02x\n", 253 - __func__, pci_domain_nr(parent), parent->number, slot_nr); 251 + dev_dbg(&parent->dev, "dev %02x, created physical slot %s\n", 252 + slot_nr, pci_slot_name(slot)); 254 253 255 254 out: 256 255 kfree(slot_name); ··· 298 299 */ 299 300 void pci_destroy_slot(struct pci_slot *slot) 300 301 { 301 - pr_debug("%s: dec refcount to %d on %04x:%02x:%02x\n", __func__, 302 - atomic_read(&slot->kobj.kref.refcount) - 1, 303 - pci_domain_nr(slot->bus), slot->bus->number, slot->number); 302 + dev_dbg(&slot->bus->dev, "dev %02x, dec refcount to %d\n", 303 + slot->number, atomic_read(&slot->kobj.kref.refcount) - 1); 304 304 305 305 down_write(&pci_bus_sem); 306 306 kobject_put(&slot->kobj);