aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci-common.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-27 15:48:22 -0400
committerPaul Mackerras <paulus@samba.org>2008-11-05 06:11:53 -0500
commitb0494bc8ee449f0534afa92a51e2e3bb27bab69b (patch)
treef83d79bf689b1247935c506bbf71fbf384359d03 /arch/powerpc/kernel/pci-common.c
parent25d6e2d7c58ddc4a3b614fc5381591c0cfe66556 (diff)
powerpc/pci: Cleanup debug printk's
This removes the various DBG() macro from the powerpc PCI code and makes it use the standard pr_debug instead. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r--arch/powerpc/kernel/pci-common.c77
1 files changed, 36 insertions, 41 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 607b43191206..09ac98e2a502 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -38,13 +38,6 @@
38#include <asm/ppc-pci.h> 38#include <asm/ppc-pci.h>
39#include <asm/firmware.h> 39#include <asm/firmware.h>
40 40
41#ifdef DEBUG
42#include <asm/udbg.h>
43#define DBG(fmt...) printk(fmt)
44#else
45#define DBG(fmt...)
46#endif
47
48static DEFINE_SPINLOCK(hose_spinlock); 41static DEFINE_SPINLOCK(hose_spinlock);
49 42
50/* XXX kill that some day ... */ 43/* XXX kill that some day ... */
@@ -215,8 +208,8 @@ void __devinit pcibios_setup_new_device(struct pci_dev *dev)
215 208
216 sd->of_node = pci_device_to_OF_node(dev); 209 sd->of_node = pci_device_to_OF_node(dev);
217 210
218 DBG("PCI: device %s OF node: %s\n", pci_name(dev), 211 pr_debug("PCI: device %s OF node: %s\n", pci_name(dev),
219 sd->of_node ? sd->of_node->full_name : "<none>"); 212 sd->of_node ? sd->of_node->full_name : "<none>");
220 213
221 sd->dma_ops = pci_dma_ops; 214 sd->dma_ops = pci_dma_ops;
222#ifdef CONFIG_PPC32 215#ifdef CONFIG_PPC32
@@ -253,7 +246,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
253 return -1; 246 return -1;
254#endif 247#endif
255 248
256 DBG("Try to map irq for %s...\n", pci_name(pci_dev)); 249 pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
257 250
258#ifdef DEBUG 251#ifdef DEBUG
259 memset(&oirq, 0xff, sizeof(oirq)); 252 memset(&oirq, 0xff, sizeof(oirq));
@@ -277,26 +270,26 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
277 line == 0xff || line == 0) { 270 line == 0xff || line == 0) {
278 return -1; 271 return -1;
279 } 272 }
280 DBG(" -> no map ! Using line %d (pin %d) from PCI config\n", 273 pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
281 line, pin); 274 line, pin);
282 275
283 virq = irq_create_mapping(NULL, line); 276 virq = irq_create_mapping(NULL, line);
284 if (virq != NO_IRQ) 277 if (virq != NO_IRQ)
285 set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); 278 set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
286 } else { 279 } else {
287 DBG(" -> got one, spec %d cells (0x%08x 0x%08x...) on %s\n", 280 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
288 oirq.size, oirq.specifier[0], oirq.specifier[1], 281 oirq.size, oirq.specifier[0], oirq.specifier[1],
289 oirq.controller->full_name); 282 oirq.controller->full_name);
290 283
291 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 284 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
292 oirq.size); 285 oirq.size);
293 } 286 }
294 if(virq == NO_IRQ) { 287 if(virq == NO_IRQ) {
295 DBG(" -> failed to map !\n"); 288 pr_debug(" Failed to map !\n");
296 return -1; 289 return -1;
297 } 290 }
298 291
299 DBG(" -> mapped to linux irq %d\n", virq); 292 pr_debug(" Mapped to linux irq %d\n", virq);
300 293
301 pci_dev->irq = virq; 294 pci_dev->irq = virq;
302 295
@@ -452,8 +445,8 @@ pgprot_t pci_phys_mem_access_prot(struct file *file,
452 pci_dev_put(pdev); 445 pci_dev_put(pdev);
453 } 446 }
454 447
455 DBG("non-PCI map for %llx, prot: %lx\n", 448 pr_debug("PCI: Non-PCI map for %llx, prot: %lx\n",
456 (unsigned long long)offset, prot); 449 (unsigned long long)offset, prot);
457 450
458 return __pgprot(prot); 451 return __pgprot(prot);
459} 452}
@@ -1196,10 +1189,10 @@ static int __init reparent_resources(struct resource *parent,
1196 *pp = NULL; 1189 *pp = NULL;
1197 for (p = res->child; p != NULL; p = p->sibling) { 1190 for (p = res->child; p != NULL; p = p->sibling) {
1198 p->parent = res; 1191 p->parent = res;
1199 DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n", 1192 pr_debug("PCI: Reparented %s [%llx..%llx] under %s\n",
1200 p->name, 1193 p->name,
1201 (unsigned long long)p->start, 1194 (unsigned long long)p->start,
1202 (unsigned long long)p->end, res->name); 1195 (unsigned long long)p->end, res->name);
1203 } 1196 }
1204 return 0; 1197 return 0;
1205} 1198}
@@ -1269,14 +1262,14 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
1269 } 1262 }
1270 } 1263 }
1271 1264
1272 DBG("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx " 1265 pr_debug("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx "
1273 "[0x%x], parent %p (%s)\n", 1266 "[0x%x], parent %p (%s)\n",
1274 bus->self ? pci_name(bus->self) : "PHB", 1267 bus->self ? pci_name(bus->self) : "PHB",
1275 bus->number, i, 1268 bus->number, i,
1276 (unsigned long long)res->start, 1269 (unsigned long long)res->start,
1277 (unsigned long long)res->end, 1270 (unsigned long long)res->end,
1278 (unsigned int)res->flags, 1271 (unsigned int)res->flags,
1279 pr, (pr && pr->name) ? pr->name : "nil"); 1272 pr, (pr && pr->name) ? pr->name : "nil");
1280 1273
1281 if (pr && !(pr->flags & IORESOURCE_UNSET)) { 1274 if (pr && !(pr->flags & IORESOURCE_UNSET)) {
1282 if (request_resource(pr, res) == 0) 1275 if (request_resource(pr, res) == 0)
@@ -1303,11 +1296,11 @@ static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
1303{ 1296{
1304 struct resource *pr, *r = &dev->resource[idx]; 1297 struct resource *pr, *r = &dev->resource[idx];
1305 1298
1306 DBG("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n", 1299 pr_debug("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n",
1307 pci_name(dev), idx, 1300 pci_name(dev), idx,
1308 (unsigned long long)r->start, 1301 (unsigned long long)r->start,
1309 (unsigned long long)r->end, 1302 (unsigned long long)r->end,
1310 (unsigned int)r->flags); 1303 (unsigned int)r->flags);
1311 1304
1312 pr = pci_find_parent_resource(dev, r); 1305 pr = pci_find_parent_resource(dev, r);
1313 if (!pr || (pr->flags & IORESOURCE_UNSET) || 1306 if (!pr || (pr->flags & IORESOURCE_UNSET) ||
@@ -1315,10 +1308,11 @@ static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
1315 printk(KERN_WARNING "PCI: Cannot allocate resource region %d" 1308 printk(KERN_WARNING "PCI: Cannot allocate resource region %d"
1316 " of device %s, will remap\n", idx, pci_name(dev)); 1309 " of device %s, will remap\n", idx, pci_name(dev));
1317 if (pr) 1310 if (pr)
1318 DBG("PCI: parent is %p: %016llx-%016llx [%x]\n", pr, 1311 pr_debug("PCI: parent is %p: %016llx-%016llx [%x]\n",
1319 (unsigned long long)pr->start, 1312 pr,
1320 (unsigned long long)pr->end, 1313 (unsigned long long)pr->start,
1321 (unsigned int)pr->flags); 1314 (unsigned long long)pr->end,
1315 (unsigned int)pr->flags);
1322 /* We'll assign a new address later */ 1316 /* We'll assign a new address later */
1323 r->flags |= IORESOURCE_UNSET; 1317 r->flags |= IORESOURCE_UNSET;
1324 r->end -= r->start; 1318 r->end -= r->start;
@@ -1356,7 +1350,8 @@ static void __init pcibios_allocate_resources(int pass)
1356 * but keep it unregistered. 1350 * but keep it unregistered.
1357 */ 1351 */
1358 u32 reg; 1352 u32 reg;
1359 DBG("PCI: Switching off ROM of %s\n", pci_name(dev)); 1353 pr_debug("PCI: Switching off ROM of %s\n",
1354 pci_name(dev));
1360 r->flags &= ~IORESOURCE_ROM_ENABLE; 1355 r->flags &= ~IORESOURCE_ROM_ENABLE;
1361 pci_read_config_dword(dev, dev->rom_base_reg, &reg); 1356 pci_read_config_dword(dev, dev->rom_base_reg, &reg);
1362 pci_write_config_dword(dev, dev->rom_base_reg, 1357 pci_write_config_dword(dev, dev->rom_base_reg,
@@ -1381,7 +1376,7 @@ void __init pcibios_resource_survey(void)
1381 } 1376 }
1382 1377
1383 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) { 1378 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
1384 DBG("PCI: Assigning unassigned resouces...\n"); 1379 pr_debug("PCI: Assigning unassigned resouces...\n");
1385 pci_assign_unassigned_resources(); 1380 pci_assign_unassigned_resources();
1386 } 1381 }
1387 1382