aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-06-13 12:52:11 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-06-25 19:05:13 -0400
commit80ccba1186d48fa728dc4b1456cc07ffb07da501 (patch)
treeb58826b8d0e42e2a41e5f5632bf95e52f9dfc676 /drivers
parentb86ec7ed2877f560ff069e8ed1b433a9005619c6 (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')
-rw-r--r--drivers/pci/msi.c10
-rw-r--r--drivers/pci/pci.c40
-rw-r--r--drivers/pci/probe.c29
-rw-r--r--drivers/pci/setup-bus.c43
-rw-r--r--drivers/pci/setup-irq.c3
-rw-r--r--drivers/pci/setup-res.c70
6 files changed, 89 insertions, 106 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index ccb1974464fb..15af618d36e2 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -565,9 +565,8 @@ int pci_enable_msi(struct pci_dev* dev)
565 565
566 /* Check whether driver already requested for MSI-X irqs */ 566 /* Check whether driver already requested for MSI-X irqs */
567 if (dev->msix_enabled) { 567 if (dev->msix_enabled) {
568 printk(KERN_INFO "PCI: %s: Can't enable MSI. " 568 dev_info(&dev->dev, "can't enable MSI "
569 "Device already has MSI-X enabled\n", 569 "(MSI-X already enabled)\n");
570 pci_name(dev));
571 return -EINVAL; 570 return -EINVAL;
572 } 571 }
573 status = msi_capability_init(dev); 572 status = msi_capability_init(dev);
@@ -690,9 +689,8 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
690 689
691 /* Check whether driver already requested for MSI irq */ 690 /* Check whether driver already requested for MSI irq */
692 if (dev->msi_enabled) { 691 if (dev->msi_enabled) {
693 printk(KERN_INFO "PCI: %s: Can't enable MSI-X. " 692 dev_info(&dev->dev, "can't enable MSI-X "
694 "Device already has an MSI irq assigned\n", 693 "(MSI IRQ already assigned)\n");
695 pci_name(dev));
696 return -EINVAL; 694 return -EINVAL;
697 } 695 }
698 status = msix_capability_init(dev, entries, nvec); 696 status = msix_capability_init(dev, entries, nvec);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7869f8f75c9e..8b755a7fb4ef 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -422,8 +422,8 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
422 * to sleep if we're already in a low power state 422 * to sleep if we're already in a low power state
423 */ 423 */
424 if (state != PCI_D0 && dev->current_state > state) { 424 if (state != PCI_D0 && dev->current_state > state) {
425 printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n", 425 dev_err(&dev->dev, "invalid power transition "
426 __func__, pci_name(dev), state, dev->current_state); 426 "(from state %d to %d)\n", dev->current_state, state);
427 return -EINVAL; 427 return -EINVAL;
428 } else if (dev->current_state == state) 428 } else if (dev->current_state == state)
429 return 0; /* we're already there */ 429 return 0; /* we're already there */
@@ -431,9 +431,8 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
431 431
432 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc); 432 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
433 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { 433 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
434 printk(KERN_DEBUG 434 dev_printk(KERN_DEBUG, &dev->dev, "unsupported PM cap regs "
435 "PCI: %s has unsupported PM cap regs version (%u)\n", 435 "version (%u)\n", pmc & PCI_PM_CAP_VER_MASK);
436 pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);
437 return -EIO; 436 return -EIO;
438 } 437 }
439 438
@@ -541,7 +540,8 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
541 case PM_EVENT_HIBERNATE: 540 case PM_EVENT_HIBERNATE:
542 return PCI_D3hot; 541 return PCI_D3hot;
543 default: 542 default:
544 printk("Unrecognized suspend event %d\n", state.event); 543 dev_info(&dev->dev, "unrecognized suspend event %d\n",
544 state.event);
545 BUG(); 545 BUG();
546 } 546 }
547 return PCI_D0; 547 return PCI_D0;
@@ -566,7 +566,7 @@ static int pci_save_pcie_state(struct pci_dev *dev)
566 else 566 else
567 found = 1; 567 found = 1;
568 if (!save_state) { 568 if (!save_state) {
569 dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); 569 dev_err(&dev->dev, "out of memory in pci_save_pcie_state\n");
570 return -ENOMEM; 570 return -ENOMEM;
571 } 571 }
572 cap = (u16 *)&save_state->data[0]; 572 cap = (u16 *)&save_state->data[0];
@@ -617,7 +617,7 @@ static int pci_save_pcix_state(struct pci_dev *dev)
617 else 617 else
618 found = 1; 618 found = 1;
619 if (!save_state) { 619 if (!save_state) {
620 dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); 620 dev_err(&dev->dev, "out of memory in pci_save_pcie_state\n");
621 return -ENOMEM; 621 return -ENOMEM;
622 } 622 }
623 cap = (u16 *)&save_state->data[0]; 623 cap = (u16 *)&save_state->data[0];
@@ -683,10 +683,9 @@ pci_restore_state(struct pci_dev *dev)
683 for (i = 15; i >= 0; i--) { 683 for (i = 15; i >= 0; i--) {
684 pci_read_config_dword(dev, i * 4, &val); 684 pci_read_config_dword(dev, i * 4, &val);
685 if (val != dev->saved_config_space[i]) { 685 if (val != dev->saved_config_space[i]) {
686 printk(KERN_DEBUG "PM: Writing back config space on " 686 dev_printk(KERN_DEBUG, &dev->dev, "restoring config "
687 "device %s at offset %x (was %x, writing %x)\n", 687 "space at offset %#x (was %#x, writing %#x)\n",
688 pci_name(dev), i, 688 i, val, (int)dev->saved_config_space[i]);
689 val, (int)dev->saved_config_space[i]);
690 pci_write_config_dword(dev,i * 4, 689 pci_write_config_dword(dev,i * 4,
691 dev->saved_config_space[i]); 690 dev->saved_config_space[i]);
692 } 691 }
@@ -1114,13 +1113,11 @@ int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name)
1114 return 0; 1113 return 0;
1115 1114
1116err_out: 1115err_out:
1117 printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%llx@%llx " 1116 dev_warn(&pdev->dev, "BAR %d: can't reserve %s region [%#llx-%#llx]\n",
1118 "for device %s\n",
1119 pci_resource_flags(pdev, bar) & IORESOURCE_IO ? "I/O" : "mem",
1120 bar + 1, /* PCI BAR # */ 1117 bar + 1, /* PCI BAR # */
1121 (unsigned long long)pci_resource_len(pdev, bar), 1118 pci_resource_flags(pdev, bar) & IORESOURCE_IO ? "I/O" : "mem",
1122 (unsigned long long)pci_resource_start(pdev, bar), 1119 (unsigned long long)pci_resource_start(pdev, bar),
1123 pci_name(pdev)); 1120 (unsigned long long)pci_resource_end(pdev, bar));
1124 return -EBUSY; 1121 return -EBUSY;
1125} 1122}
1126 1123
@@ -1212,7 +1209,7 @@ pci_set_master(struct pci_dev *dev)
1212 1209
1213 pci_read_config_word(dev, PCI_COMMAND, &cmd); 1210 pci_read_config_word(dev, PCI_COMMAND, &cmd);
1214 if (! (cmd & PCI_COMMAND_MASTER)) { 1211 if (! (cmd & PCI_COMMAND_MASTER)) {
1215 pr_debug("PCI: Enabling bus mastering for device %s\n", pci_name(dev)); 1212 dev_dbg(&dev->dev, "enabling bus mastering\n");
1216 cmd |= PCI_COMMAND_MASTER; 1213 cmd |= PCI_COMMAND_MASTER;
1217 pci_write_config_word(dev, PCI_COMMAND, cmd); 1214 pci_write_config_word(dev, PCI_COMMAND, cmd);
1218 } 1215 }
@@ -1277,8 +1274,8 @@ pci_set_cacheline_size(struct pci_dev *dev)
1277 if (cacheline_size == pci_cache_line_size) 1274 if (cacheline_size == pci_cache_line_size)
1278 return 0; 1275 return 0;
1279 1276
1280 printk(KERN_DEBUG "PCI: cache line size of %d is not supported " 1277 dev_printk(KERN_DEBUG, &dev->dev, "cache line size of %d is not "
1281 "by device %s\n", pci_cache_line_size << 2, pci_name(dev)); 1278 "supported\n", pci_cache_line_size << 2);
1282 1279
1283 return -EINVAL; 1280 return -EINVAL;
1284} 1281}
@@ -1303,8 +1300,7 @@ pci_set_mwi(struct pci_dev *dev)
1303 1300
1304 pci_read_config_word(dev, PCI_COMMAND, &cmd); 1301 pci_read_config_word(dev, PCI_COMMAND, &cmd);
1305 if (! (cmd & PCI_COMMAND_INVALIDATE)) { 1302 if (! (cmd & PCI_COMMAND_INVALIDATE)) {
1306 pr_debug("PCI: Enabling Mem-Wr-Inval for device %s\n", 1303 dev_dbg(&dev->dev, "enabling Mem-Wr-Inval\n");
1307 pci_name(dev));
1308 cmd |= PCI_COMMAND_INVALIDATE; 1304 cmd |= PCI_COMMAND_INVALIDATE;
1309 pci_write_config_word(dev, PCI_COMMAND, cmd); 1305 pci_write_config_word(dev, PCI_COMMAND, cmd);
1310 } 1306 }
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));
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 8ddb918f5f57..827c0a520e2b 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -27,13 +27,6 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28 28
29 29
30#define DEBUG_CONFIG 1
31#if DEBUG_CONFIG
32#define DBG(x...) printk(x)
33#else
34#define DBG(x...)
35#endif
36
37static void pbus_assign_resources_sorted(struct pci_bus *bus) 30static void pbus_assign_resources_sorted(struct pci_bus *bus)
38{ 31{
39 struct pci_dev *dev; 32 struct pci_dev *dev;
@@ -81,8 +74,8 @@ void pci_setup_cardbus(struct pci_bus *bus)
81 struct pci_dev *bridge = bus->self; 74 struct pci_dev *bridge = bus->self;
82 struct pci_bus_region region; 75 struct pci_bus_region region;
83 76
84 printk("PCI: Bus %d, cardbus bridge: %s\n", 77 dev_info(&bridge->dev, "CardBus bridge, secondary bus %04x:%02x\n",
85 bus->number, pci_name(bridge)); 78 pci_domain_nr(bus), bus->number);
86 79
87 pcibios_resource_to_bus(bridge, &region, bus->resource[0]); 80 pcibios_resource_to_bus(bridge, &region, bus->resource[0]);
88 if (bus->resource[0]->flags & IORESOURCE_IO) { 81 if (bus->resource[0]->flags & IORESOURCE_IO) {
@@ -90,7 +83,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
90 * The IO resource is allocated a range twice as large as it 83 * The IO resource is allocated a range twice as large as it
91 * would normally need. This allows us to set both IO regs. 84 * would normally need. This allows us to set both IO regs.
92 */ 85 */
93 printk(KERN_INFO " IO window: 0x%08lx-0x%08lx\n", 86 dev_info(&bridge->dev, " IO window: %#08lx-%#08lx\n",
94 (unsigned long)region.start, 87 (unsigned long)region.start,
95 (unsigned long)region.end); 88 (unsigned long)region.end);
96 pci_write_config_dword(bridge, PCI_CB_IO_BASE_0, 89 pci_write_config_dword(bridge, PCI_CB_IO_BASE_0,
@@ -101,7 +94,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
101 94
102 pcibios_resource_to_bus(bridge, &region, bus->resource[1]); 95 pcibios_resource_to_bus(bridge, &region, bus->resource[1]);
103 if (bus->resource[1]->flags & IORESOURCE_IO) { 96 if (bus->resource[1]->flags & IORESOURCE_IO) {
104 printk(KERN_INFO " IO window: 0x%08lx-0x%08lx\n", 97 dev_info(&bridge->dev, " IO window: %#08lx-%#08lx\n",
105 (unsigned long)region.start, 98 (unsigned long)region.start,
106 (unsigned long)region.end); 99 (unsigned long)region.end);
107 pci_write_config_dword(bridge, PCI_CB_IO_BASE_1, 100 pci_write_config_dword(bridge, PCI_CB_IO_BASE_1,
@@ -112,7 +105,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
112 105
113 pcibios_resource_to_bus(bridge, &region, bus->resource[2]); 106 pcibios_resource_to_bus(bridge, &region, bus->resource[2]);
114 if (bus->resource[2]->flags & IORESOURCE_MEM) { 107 if (bus->resource[2]->flags & IORESOURCE_MEM) {
115 printk(KERN_INFO " PREFETCH window: 0x%08lx-0x%08lx\n", 108 dev_info(&bridge->dev, " PREFETCH window: %#08lx-%#08lx\n",
116 (unsigned long)region.start, 109 (unsigned long)region.start,
117 (unsigned long)region.end); 110 (unsigned long)region.end);
118 pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_0, 111 pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_0,
@@ -123,7 +116,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
123 116
124 pcibios_resource_to_bus(bridge, &region, bus->resource[3]); 117 pcibios_resource_to_bus(bridge, &region, bus->resource[3]);
125 if (bus->resource[3]->flags & IORESOURCE_MEM) { 118 if (bus->resource[3]->flags & IORESOURCE_MEM) {
126 printk(KERN_INFO " MEM window: 0x%08lx-0x%08lx\n", 119 dev_info(&bridge->dev, " MEM window: %#08lx-%#08lx\n",
127 (unsigned long)region.start, 120 (unsigned long)region.start,
128 (unsigned long)region.end); 121 (unsigned long)region.end);
129 pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_1, 122 pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_1,
@@ -151,7 +144,8 @@ static void pci_setup_bridge(struct pci_bus *bus)
151 struct pci_bus_region region; 144 struct pci_bus_region region;
152 u32 l, bu, lu, io_upper16; 145 u32 l, bu, lu, io_upper16;
153 146
154 DBG(KERN_INFO "PCI: Bridge: %s\n", pci_name(bridge)); 147 dev_info(&bridge->dev, "PCI bridge, secondary bus %04x:%02x\n",
148 pci_domain_nr(bus), bus->number);
155 149
156 /* Set up the top and bottom of the PCI I/O segment for this bus. */ 150 /* Set up the top and bottom of the PCI I/O segment for this bus. */
157 pcibios_resource_to_bus(bridge, &region, bus->resource[0]); 151 pcibios_resource_to_bus(bridge, &region, bus->resource[0]);
@@ -162,7 +156,7 @@ static void pci_setup_bridge(struct pci_bus *bus)
162 l |= region.end & 0xf000; 156 l |= region.end & 0xf000;
163 /* Set up upper 16 bits of I/O base/limit. */ 157 /* Set up upper 16 bits of I/O base/limit. */
164 io_upper16 = (region.end & 0xffff0000) | (region.start >> 16); 158 io_upper16 = (region.end & 0xffff0000) | (region.start >> 16);
165 DBG(KERN_INFO " IO window: %04lx-%04lx\n", 159 dev_info(&bridge->dev, " IO window: %#04lx-%#04lx\n",
166 (unsigned long)region.start, 160 (unsigned long)region.start,
167 (unsigned long)region.end); 161 (unsigned long)region.end);
168 } 162 }
@@ -170,7 +164,7 @@ static void pci_setup_bridge(struct pci_bus *bus)
170 /* Clear upper 16 bits of I/O base/limit. */ 164 /* Clear upper 16 bits of I/O base/limit. */
171 io_upper16 = 0; 165 io_upper16 = 0;
172 l = 0x00f0; 166 l = 0x00f0;
173 DBG(KERN_INFO " IO window: disabled.\n"); 167 dev_info(&bridge->dev, " IO window: disabled\n");
174 } 168 }
175 /* Temporarily disable the I/O range before updating PCI_IO_BASE. */ 169 /* Temporarily disable the I/O range before updating PCI_IO_BASE. */
176 pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, 0x0000ffff); 170 pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, 0x0000ffff);
@@ -185,13 +179,13 @@ static void pci_setup_bridge(struct pci_bus *bus)
185 if (bus->resource[1]->flags & IORESOURCE_MEM) { 179 if (bus->resource[1]->flags & IORESOURCE_MEM) {
186 l = (region.start >> 16) & 0xfff0; 180 l = (region.start >> 16) & 0xfff0;
187 l |= region.end & 0xfff00000; 181 l |= region.end & 0xfff00000;
188 DBG(KERN_INFO " MEM window: 0x%08lx-0x%08lx\n", 182 dev_info(&bridge->dev, " MEM window: %#08lx-%#08lx\n",
189 (unsigned long)region.start, 183 (unsigned long)region.start,
190 (unsigned long)region.end); 184 (unsigned long)region.end);
191 } 185 }
192 else { 186 else {
193 l = 0x0000fff0; 187 l = 0x0000fff0;
194 DBG(KERN_INFO " MEM window: disabled.\n"); 188 dev_info(&bridge->dev, " MEM window: disabled\n");
195 } 189 }
196 pci_write_config_dword(bridge, PCI_MEMORY_BASE, l); 190 pci_write_config_dword(bridge, PCI_MEMORY_BASE, l);
197 191
@@ -208,13 +202,13 @@ static void pci_setup_bridge(struct pci_bus *bus)
208 l |= region.end & 0xfff00000; 202 l |= region.end & 0xfff00000;
209 bu = upper_32_bits(region.start); 203 bu = upper_32_bits(region.start);
210 lu = upper_32_bits(region.end); 204 lu = upper_32_bits(region.end);
211 DBG(KERN_INFO " PREFETCH window: 0x%016llx-0x%016llx\n", 205 dev_info(&bridge->dev, " PREFETCH window: %#016llx-%#016llx\n",
212 (unsigned long long)region.start, 206 (unsigned long long)region.start,
213 (unsigned long long)region.end); 207 (unsigned long long)region.end);
214 } 208 }
215 else { 209 else {
216 l = 0x0000fff0; 210 l = 0x0000fff0;
217 DBG(KERN_INFO " PREFETCH window: disabled.\n"); 211 dev_info(&bridge->dev, " PREFETCH window: disabled\n");
218 } 212 }
219 pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, l); 213 pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, l);
220 214
@@ -361,9 +355,8 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long
361 align = (i < PCI_BRIDGE_RESOURCES) ? r_size : r->start; 355 align = (i < PCI_BRIDGE_RESOURCES) ? r_size : r->start;
362 order = __ffs(align) - 20; 356 order = __ffs(align) - 20;
363 if (order > 11) { 357 if (order > 11) {
364 printk(KERN_WARNING "PCI: region %s/%d " 358 dev_warn(&dev->dev, "BAR %d too large: "
365 "too large: 0x%016llx-0x%016llx\n", 359 "%#016llx-%#016llx\n", i,
366 pci_name(dev), i,
367 (unsigned long long)r->start, 360 (unsigned long long)r->start,
368 (unsigned long long)r->end); 361 (unsigned long long)r->end);
369 r->flags = 0; 362 r->flags = 0;
@@ -529,8 +522,8 @@ void __ref pci_bus_assign_resources(struct pci_bus *bus)
529 break; 522 break;
530 523
531 default: 524 default:
532 printk(KERN_INFO "PCI: not setting up bridge %s " 525 dev_info(&dev->dev, "not setting up bridge for bus "
533 "for bus %d\n", pci_name(dev), b->number); 526 "%04x:%02x\n", pci_domain_nr(b), b->number);
534 break; 527 break;
535 } 528 }
536 } 529 }
diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
index 05ca2ed9eb51..aa795fd428de 100644
--- a/drivers/pci/setup-irq.c
+++ b/drivers/pci/setup-irq.c
@@ -47,8 +47,7 @@ pdev_fixup_irq(struct pci_dev *dev,
47 } 47 }
48 dev->irq = irq; 48 dev->irq = irq;
49 49
50 pr_debug("PCI: fixup irq: (%s) got %d\n", 50 dev_dbg(&dev->dev, "fixup irq: got %d\n", dev->irq);
51 kobject_name(&dev->dev.kobj), dev->irq);
52 51
53 /* Always tell the device, so the driver knows what is 52 /* Always tell the device, so the driver knows what is
54 the real IRQ to use; the device does not use it. */ 53 the real IRQ to use; the device does not use it. */
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 7d35cdf4579f..1a5fc83c71b3 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -26,8 +26,7 @@
26#include "pci.h" 26#include "pci.h"
27 27
28 28
29void 29void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
30pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
31{ 30{
32 struct pci_bus_region region; 31 struct pci_bus_region region;
33 u32 new, check, mask; 32 u32 new, check, mask;
@@ -43,20 +42,20 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
43 /* 42 /*
44 * Ignore non-moveable resources. This might be legacy resources for 43 * Ignore non-moveable resources. This might be legacy resources for
45 * which no functional BAR register exists or another important 44 * which no functional BAR register exists or another important
46 * system resource we should better not move around in system address 45 * system resource we shouldn't move around.
47 * space.
48 */ 46 */
49 if (res->flags & IORESOURCE_PCI_FIXED) 47 if (res->flags & IORESOURCE_PCI_FIXED)
50 return; 48 return;
51 49
52 pcibios_resource_to_bus(dev, &region, res); 50 pcibios_resource_to_bus(dev, &region, res);
53 51
54 pr_debug(" got res [%llx:%llx] bus [%llx:%llx] flags %lx for " 52 dev_dbg(&dev->dev, "BAR %d: got res [%#llx-%#llx] bus [%#llx-%#llx] "
55 "BAR %d of %s\n", (unsigned long long)res->start, 53 "flags %#lx\n", resno,
54 (unsigned long long)res->start,
56 (unsigned long long)res->end, 55 (unsigned long long)res->end,
57 (unsigned long long)region.start, 56 (unsigned long long)region.start,
58 (unsigned long long)region.end, 57 (unsigned long long)region.end,
59 (unsigned long)res->flags, resno, pci_name(dev)); 58 (unsigned long)res->flags);
60 59
61 new = region.start | (res->flags & PCI_REGION_FLAG_MASK); 60 new = region.start | (res->flags & PCI_REGION_FLAG_MASK);
62 if (res->flags & IORESOURCE_IO) 61 if (res->flags & IORESOURCE_IO)
@@ -81,9 +80,8 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
81 pci_read_config_dword(dev, reg, &check); 80 pci_read_config_dword(dev, reg, &check);
82 81
83 if ((new ^ check) & mask) { 82 if ((new ^ check) & mask) {
84 printk(KERN_ERR "PCI: Error while updating region " 83 dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n",
85 "%s/%d (%08x != %08x)\n", pci_name(dev), resno, 84 resno, new, check);
86 new, check);
87 } 85 }
88 86
89 if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == 87 if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
@@ -92,15 +90,14 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
92 pci_write_config_dword(dev, reg + 4, new); 90 pci_write_config_dword(dev, reg + 4, new);
93 pci_read_config_dword(dev, reg + 4, &check); 91 pci_read_config_dword(dev, reg + 4, &check);
94 if (check != new) { 92 if (check != new) {
95 printk(KERN_ERR "PCI: Error updating region " 93 dev_err(&dev->dev, "BAR %d: error updating "
96 "%s/%d (high %08x != %08x)\n", 94 "(high %#08x != %#08x)\n", resno, new, check);
97 pci_name(dev), resno, new, check);
98 } 95 }
99 } 96 }
100 res->flags &= ~IORESOURCE_UNSET; 97 res->flags &= ~IORESOURCE_UNSET;
101 pr_debug("PCI: moved device %s resource %d (%lx) to %x\n", 98 dev_dbg(&dev->dev, "BAR %d: moved to bus [%#llx-%#llx] flags %#lx\n",
102 pci_name(dev), resno, res->flags, 99 resno, (unsigned long long)region.start,
103 new & ~PCI_REGION_FLAG_MASK); 100 (unsigned long long)region.end, res->flags);
104} 101}
105 102
106int pci_claim_resource(struct pci_dev *dev, int resource) 103int pci_claim_resource(struct pci_dev *dev, int resource)
@@ -117,10 +114,11 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
117 err = insert_resource(root, res); 114 err = insert_resource(root, res);
118 115
119 if (err) { 116 if (err) {
120 printk(KERN_ERR "PCI: %s region %d of %s %s [%llx:%llx]\n", 117 dev_err(&dev->dev, "BAR %d: %s of %s [%#llx-%#llx]\n",
121 root ? "Address space collision on" : 118 resource,
122 "No parent found for", 119 root ? "address space collision on" :
123 resource, dtype, pci_name(dev), 120 "no parent found for",
121 dtype,
124 (unsigned long long)res->start, 122 (unsigned long long)res->start,
125 (unsigned long long)res->end); 123 (unsigned long long)res->end);
126 } 124 }
@@ -140,11 +138,10 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
140 138
141 align = resource_alignment(res); 139 align = resource_alignment(res);
142 if (!align) { 140 if (!align) {
143 printk(KERN_ERR "PCI: Cannot allocate resource (bogus " 141 dev_err(&dev->dev, "BAR %d: can't allocate resource (bogus "
144 "alignment) %d [%llx:%llx] (flags %lx) of %s\n", 142 "alignment) [%#llx-%#llx] flags %#lx\n",
145 resno, (unsigned long long)res->start, 143 resno, (unsigned long long)res->start,
146 (unsigned long long)res->end, res->flags, 144 (unsigned long long)res->end, res->flags);
147 pci_name(dev));
148 return -EINVAL; 145 return -EINVAL;
149 } 146 }
150 147
@@ -165,11 +162,11 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
165 } 162 }
166 163
167 if (ret) { 164 if (ret) {
168 printk(KERN_ERR "PCI: Failed to allocate %s resource " 165 dev_err(&dev->dev, "BAR %d: can't allocate %s resource "
169 "#%d:%llx@%llx for %s\n", 166 "[%#llx-%#llx]\n", resno,
170 res->flags & IORESOURCE_IO ? "I/O" : "mem", 167 res->flags & IORESOURCE_IO ? "I/O" : "mem",
171 resno, (unsigned long long)size, 168 (unsigned long long)res->start,
172 (unsigned long long)res->start, pci_name(dev)); 169 (unsigned long long)res->end);
173 } else { 170 } else {
174 res->flags &= ~IORESOURCE_STARTALIGN; 171 res->flags &= ~IORESOURCE_STARTALIGN;
175 if (resno < PCI_BRIDGE_RESOURCES) 172 if (resno < PCI_BRIDGE_RESOURCES)
@@ -205,11 +202,11 @@ int pci_assign_resource_fixed(struct pci_dev *dev, int resno)
205 } 202 }
206 203
207 if (ret) { 204 if (ret) {
208 printk(KERN_ERR "PCI: Failed to allocate %s resource " 205 dev_err(&dev->dev, "BAR %d: can't allocate %s resource "
209 "#%d:%llx@%llx for %s\n", 206 "[%#llx-%#llx\n]", resno,
210 res->flags & IORESOURCE_IO ? "I/O" : "mem", 207 res->flags & IORESOURCE_IO ? "I/O" : "mem",
211 resno, (unsigned long long)(res->end - res->start + 1), 208 (unsigned long long)res->start,
212 (unsigned long long)res->start, pci_name(dev)); 209 (unsigned long long)res->end);
213 } else if (resno < PCI_BRIDGE_RESOURCES) { 210 } else if (resno < PCI_BRIDGE_RESOURCES) {
214 pci_update_resource(dev, res, resno); 211 pci_update_resource(dev, res, resno);
215 } 212 }
@@ -239,11 +236,10 @@ void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
239 236
240 r_align = resource_alignment(r); 237 r_align = resource_alignment(r);
241 if (!r_align) { 238 if (!r_align) {
242 printk(KERN_WARNING "PCI: bogus alignment of resource " 239 dev_warn(&dev->dev, "BAR %d: bogus alignment "
243 "%d [%llx:%llx] (flags %lx) of %s\n", 240 "[%#llx-%#llx] flags %#lx\n",
244 i, (unsigned long long)r->start, 241 i, (unsigned long long)r->start,
245 (unsigned long long)r->end, r->flags, 242 (unsigned long long)r->end, r->flags);
246 pci_name(dev));
247 continue; 243 continue;
248 } 244 }
249 for (list = head; ; list = list->next) { 245 for (list = head; ; list = list->next) {
@@ -291,7 +287,7 @@ int pci_enable_resources(struct pci_dev *dev, int mask)
291 287
292 if (!r->parent) { 288 if (!r->parent) {
293 dev_err(&dev->dev, "device not available because of " 289 dev_err(&dev->dev, "device not available because of "
294 "BAR %d [%llx:%llx] collisions\n", i, 290 "BAR %d [%#llx-%#llx] collisions\n", i,
295 (unsigned long long) r->start, 291 (unsigned long long) r->start,
296 (unsigned long long) r->end); 292 (unsigned long long) r->end);
297 return -EINVAL; 293 return -EINVAL;