diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-06-13 12:52:11 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-06-25 19:05:13 -0400 |
commit | 80ccba1186d48fa728dc4b1456cc07ffb07da501 (patch) | |
tree | b58826b8d0e42e2a41e5f5632bf95e52f9dfc676 /drivers/pci/probe.c | |
parent | b86ec7ed2877f560ff069e8ed1b433a9005619c6 (diff) |
PCI: use dev_printk when possible
Convert printks to use dev_printk().
I converted pr_debug() to dev_dbg(). Both use KERN_DEBUG and are enabled
only when DEBUG is defined.
I converted printk(KERN_DEBUG) to dev_printk(KERN_DEBUG), not to dev_dbg(),
because dev_dbg() is only enabled when DEBUG is defined.
I converted DBG(KERN_INFO) (only in setup-bus.c) to dev_info(). The DBG()
name makes it sound like debug, but it's been enabled forever, so dev_info()
preserves the previous behavior.
I tried to make the resource assignment formats more consistent, e.g.,
"BAR %d: got res [%#llx-%#llx] bus [%#llx-%#llx] flags %#lx\n"
instead of sometimes using "start-end" and sometimes using "size@start".
I'm not attached to one or the other; I'd just like them consistent.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4562827b7e22..f8291191ef91 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -277,8 +277,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) | |||
277 | res->end = res->start + sz64; | 277 | res->end = res->start + sz64; |
278 | #else | 278 | #else |
279 | if (sz64 > 0x100000000ULL) { | 279 | if (sz64 > 0x100000000ULL) { |
280 | printk(KERN_ERR "PCI: Unable to handle 64-bit " | 280 | dev_err(&dev->dev, "BAR %d: can't handle 64-bit" |
281 | "BAR for device %s\n", pci_name(dev)); | 281 | " BAR\n", pos); |
282 | res->start = 0; | 282 | res->start = 0; |
283 | res->flags = 0; | 283 | res->flags = 0; |
284 | } else if (lhi) { | 284 | } else if (lhi) { |
@@ -329,7 +329,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
329 | return; | 329 | return; |
330 | 330 | ||
331 | if (dev->transparent) { | 331 | if (dev->transparent) { |
332 | printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); | 332 | dev_info(&dev->dev, "transparent bridge\n"); |
333 | for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) | 333 | for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++) |
334 | child->resource[i] = child->parent->resource[i - 3]; | 334 | child->resource[i] = child->parent->resource[i - 3]; |
335 | } | 335 | } |
@@ -392,7 +392,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
392 | limit |= ((long) mem_limit_hi) << 32; | 392 | limit |= ((long) mem_limit_hi) << 32; |
393 | #else | 393 | #else |
394 | if (mem_base_hi || mem_limit_hi) { | 394 | if (mem_base_hi || mem_limit_hi) { |
395 | printk(KERN_ERR "PCI: Unable to handle 64-bit address space for bridge %s\n", pci_name(dev)); | 395 | dev_err(&dev->dev, "can't handle 64-bit " |
396 | "address space for bridge\n"); | ||
396 | return; | 397 | return; |
397 | } | 398 | } |
398 | #endif | 399 | #endif |
@@ -512,8 +513,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
512 | 513 | ||
513 | pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); | 514 | pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses); |
514 | 515 | ||
515 | pr_debug("PCI: Scanning behind PCI bridge %s, config %06x, pass %d\n", | 516 | dev_dbg(&dev->dev, "scanning behind bridge, config %06x, pass %d\n", |
516 | pci_name(dev), buses & 0xffffff, pass); | 517 | buses & 0xffffff, pass); |
517 | 518 | ||
518 | /* Disable MasterAbortMode during probing to avoid reporting | 519 | /* Disable MasterAbortMode during probing to avoid reporting |
519 | of bus errors (in some architectures) */ | 520 | of bus errors (in some architectures) */ |
@@ -536,8 +537,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
536 | * ignore it. This can happen with the i450NX chipset. | 537 | * ignore it. This can happen with the i450NX chipset. |
537 | */ | 538 | */ |
538 | if (pci_find_bus(pci_domain_nr(bus), busnr)) { | 539 | if (pci_find_bus(pci_domain_nr(bus), busnr)) { |
539 | printk(KERN_INFO "PCI: Bus %04x:%02x already known\n", | 540 | dev_info(&dev->dev, "bus %04x:%02x already known\n", |
540 | pci_domain_nr(bus), busnr); | 541 | pci_domain_nr(bus), busnr); |
541 | goto out; | 542 | goto out; |
542 | } | 543 | } |
543 | 544 | ||
@@ -721,7 +722,7 @@ static int pci_setup_device(struct pci_dev * dev) | |||
721 | dev->class = class; | 722 | dev->class = class; |
722 | class >>= 8; | 723 | class >>= 8; |
723 | 724 | ||
724 | pr_debug("PCI: Found %s [%04x/%04x] %06x %02x\n", pci_name(dev), | 725 | dev_dbg(&dev->dev, "found [%04x/%04x] class %06x header type %02x\n", |
725 | dev->vendor, dev->device, class, dev->hdr_type); | 726 | dev->vendor, dev->device, class, dev->hdr_type); |
726 | 727 | ||
727 | /* "Unknown power state" */ | 728 | /* "Unknown power state" */ |
@@ -789,13 +790,13 @@ static int pci_setup_device(struct pci_dev * dev) | |||
789 | break; | 790 | break; |
790 | 791 | ||
791 | default: /* unknown header */ | 792 | default: /* unknown header */ |
792 | printk(KERN_ERR "PCI: device %s has unknown header type %02x, ignoring.\n", | 793 | dev_err(&dev->dev, "unknown header type %02x, " |
793 | pci_name(dev), dev->hdr_type); | 794 | "ignoring device\n", dev->hdr_type); |
794 | return -1; | 795 | return -1; |
795 | 796 | ||
796 | bad: | 797 | bad: |
797 | printk(KERN_ERR "PCI: %s: class %x doesn't match header type %02x. Ignoring class.\n", | 798 | dev_err(&dev->dev, "ignoring class %02x (doesn't match header " |
798 | pci_name(dev), class, dev->hdr_type); | 799 | "type %02x)\n", class, dev->hdr_type); |
799 | dev->class = PCI_CLASS_NOT_DEFINED; | 800 | dev->class = PCI_CLASS_NOT_DEFINED; |
800 | } | 801 | } |
801 | 802 | ||
@@ -971,7 +972,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) | |||
971 | return NULL; | 972 | return NULL; |
972 | /* Card hasn't responded in 60 seconds? Must be stuck. */ | 973 | /* Card hasn't responded in 60 seconds? Must be stuck. */ |
973 | if (delay > 60 * 1000) { | 974 | if (delay > 60 * 1000) { |
974 | printk(KERN_WARNING "Device %04x:%02x:%02x.%d not " | 975 | printk(KERN_WARNING "pci %04x:%02x:%02x.%d: not " |
975 | "responding\n", pci_domain_nr(bus), | 976 | "responding\n", pci_domain_nr(bus), |
976 | bus->number, PCI_SLOT(devfn), | 977 | bus->number, PCI_SLOT(devfn), |
977 | PCI_FUNC(devfn)); | 978 | PCI_FUNC(devfn)); |