Commit 62795041 authored by Alex Chiang's avatar Alex Chiang Committed by Jesse Barnes

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: default avatarAndrew Patterson <andrew.patterson@hp.com>
Signed-off-by: default avatarAlex Chiang <achiang@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 6a82e218
/* /*
* drivers/pci/slot.c * drivers/pci/slot.c
* Copyright (C) 2006 Matthew Wilcox <matthew@wil.cx> * Copyright (C) 2006 Matthew Wilcox <matthew@wil.cx>
* Copyright (C) 2006-2008 Hewlett-Packard Development Company, L.P. * Copyright (C) 2006-2009 Hewlett-Packard Development Company, L.P.
* Alex Chiang <achiang@hp.com> * Alex Chiang <achiang@hp.com>
*/ */
...@@ -52,8 +52,8 @@ static void pci_slot_release(struct kobject *kobj) ...@@ -52,8 +52,8 @@ static void pci_slot_release(struct kobject *kobj)
struct pci_dev *dev; struct pci_dev *dev;
struct pci_slot *slot = to_pci_slot(kobj); struct pci_slot *slot = to_pci_slot(kobj);
pr_debug("%s: releasing pci_slot on %x:%d\n", __func__, dev_dbg(&slot->bus->dev, "dev %02x, released physical slot %s\n",
slot->bus->number, slot->number); slot->number, pci_slot_name(slot));
list_for_each_entry(dev, &slot->bus->devices, bus_list) list_for_each_entry(dev, &slot->bus->devices, bus_list)
if (PCI_SLOT(dev->devfn) == slot->number) if (PCI_SLOT(dev->devfn) == slot->number)
...@@ -248,9 +248,8 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, ...@@ -248,9 +248,8 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
if (PCI_SLOT(dev->devfn) == slot_nr) if (PCI_SLOT(dev->devfn) == slot_nr)
dev->slot = slot; dev->slot = slot;
/* Don't care if debug printk has a -1 for slot_nr */ dev_dbg(&parent->dev, "dev %02x, created physical slot %s\n",
pr_debug("%s: created pci_slot on %04x:%02x:%02x\n", slot_nr, pci_slot_name(slot));
__func__, pci_domain_nr(parent), parent->number, slot_nr);
out: out:
kfree(slot_name); kfree(slot_name);
...@@ -299,9 +298,8 @@ EXPORT_SYMBOL_GPL(pci_renumber_slot); ...@@ -299,9 +298,8 @@ EXPORT_SYMBOL_GPL(pci_renumber_slot);
*/ */
void pci_destroy_slot(struct pci_slot *slot) void pci_destroy_slot(struct pci_slot *slot)
{ {
pr_debug("%s: dec refcount to %d on %04x:%02x:%02x\n", __func__, dev_dbg(&slot->bus->dev, "dev %02x, dec refcount to %d\n",
atomic_read(&slot->kobj.kref.refcount) - 1, slot->number, atomic_read(&slot->kobj.kref.refcount) - 1);
pci_domain_nr(slot->bus), slot->bus->number, slot->number);
down_write(&pci_bus_sem); down_write(&pci_bus_sem);
kobject_put(&slot->kobj); kobject_put(&slot->kobj);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment