aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-10-06 17:33:44 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-04 11:47:18 -0500
commita369c791e881503a6253dafc0d0ad5e41e5557e5 (patch)
tree20de1e773f328875afbfaf96fedd3991e9288f68 /drivers/pci/probe.c
parentfd95541e23e2c9acb1e38cd41fc0c7cc37fceb53 (diff)
PCI: print resources consistently with %pRt
This uses %pRt to print additional resource information (type, size, prefetchability, etc.) consistently. 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.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 8105e32117f6..2adb47574d86 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -222,6 +222,8 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
222 if (!sz64) 222 if (!sz64)
223 goto fail; 223 goto fail;
224 224
225 res->flags |= IORESOURCE_MEM_64;
226
225 if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) { 227 if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) {
226 dev_err(&dev->dev, "can't handle 64-bit BAR\n"); 228 dev_err(&dev->dev, "can't handle 64-bit BAR\n");
227 goto fail; 229 goto fail;
@@ -234,14 +236,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
234 } else { 236 } else {
235 res->start = l64; 237 res->start = l64;
236 res->end = l64 + sz64; 238 res->end = l64 + sz64;
237 dev_printk(KERN_DEBUG, &dev->dev, 239 dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pRt\n",
238 "reg %x %s: %pR\n", pos, 240 pos, res);
239 (res->flags & IORESOURCE_PREFETCH) ?
240 "64bit mmio pref" : "64bit mmio",
241 res);
242 } 241 }
243
244 res->flags |= IORESOURCE_MEM_64;
245 } else { 242 } else {
246 sz = pci_size(l, sz, mask); 243 sz = pci_size(l, sz, mask);
247 244
@@ -251,11 +248,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
251 res->start = l; 248 res->start = l;
252 res->end = l + sz; 249 res->end = l + sz;
253 250
254 dev_printk(KERN_DEBUG, &dev->dev, "reg %x %s: %pR\n", pos, 251 dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pRt\n", pos, res);
255 (res->flags & IORESOURCE_IO) ? "io port" :
256 ((res->flags & IORESOURCE_PREFETCH) ?
257 "32bit mmio pref" : "32bit mmio"),
258 res);
259 } 252 }
260 253
261 out: 254 out:
@@ -323,7 +316,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
323 res->start = base; 316 res->start = base;
324 if (!res->end) 317 if (!res->end)
325 res->end = limit + 0xfff; 318 res->end = limit + 0xfff;
326 dev_printk(KERN_DEBUG, &dev->dev, "bridge io port: %pR\n", res); 319 dev_printk(KERN_DEBUG, &dev->dev, "bridge window: %pRt\n", res);
327 } 320 }
328 321
329 res = child->resource[1]; 322 res = child->resource[1];
@@ -335,8 +328,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
335 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; 328 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
336 res->start = base; 329 res->start = base;
337 res->end = limit + 0xfffff; 330 res->end = limit + 0xfffff;
338 dev_printk(KERN_DEBUG, &dev->dev, "bridge 32bit mmio: %pR\n", 331 dev_printk(KERN_DEBUG, &dev->dev, "bridge window: %pRt\n", res);
339 res);
340 } 332 }
341 333
342 res = child->resource[2]; 334 res = child->resource[2];
@@ -375,9 +367,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
375 res->flags |= IORESOURCE_MEM_64; 367 res->flags |= IORESOURCE_MEM_64;
376 res->start = base; 368 res->start = base;
377 res->end = limit + 0xfffff; 369 res->end = limit + 0xfffff;
378 dev_printk(KERN_DEBUG, &dev->dev, "bridge %sbit mmio pref: %pR\n", 370 dev_printk(KERN_DEBUG, &dev->dev, "bridge window: %pRt\n", res);
379 (res->flags & PCI_PREF_RANGE_TYPE_64) ? "64" : "32",
380 res);
381 } 371 }
382} 372}
383 373