aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/support.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:08 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:21 -0400
commit81b5c75f0ed22a93c3da00650d0898eec56e1d62 (patch)
treeeeaf37bd90ed40712ac07d1e606748fdd7888d2a /drivers/pnp/support.c
parent72dcc883d8e5b59105e75ee5265442e458740575 (diff)
PNP: add debug when assigning PNP resources
This patch adds code to dump PNP resources before and after assigning resources and before writing them to the device. This is enabled by CONFIG_PNP_DEBUG=y. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/support.c')
-rw-r--r--drivers/pnp/support.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c
index e848b794e312..3aeb154e27d6 100644
--- a/drivers/pnp/support.c
+++ b/drivers/pnp/support.c
@@ -51,3 +51,40 @@ void pnp_eisa_id_to_string(u32 id, char *str)
51 str[6] = hex_asc((id >> 0) & 0xf); 51 str[6] = hex_asc((id >> 0) & 0xf);
52 str[7] = '\0'; 52 str[7] = '\0';
53} 53}
54
55void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc)
56{
57#ifdef DEBUG
58 struct resource *res;
59 int i;
60
61 dev_dbg(&dev->dev, "current resources: %s\n", desc);
62
63 for (i = 0; i < PNP_MAX_IRQ; i++) {
64 res = &dev->res.irq_resource[i];
65 if (!(res->flags & IORESOURCE_UNSET))
66 dev_dbg(&dev->dev, " irq %lld flags %#lx\n",
67 (unsigned long long) res->start, res->flags);
68 }
69 for (i = 0; i < PNP_MAX_DMA; i++) {
70 res = &dev->res.dma_resource[i];
71 if (!(res->flags & IORESOURCE_UNSET))
72 dev_dbg(&dev->dev, " dma %lld flags %#lx\n",
73 (unsigned long long) res->start, res->flags);
74 }
75 for (i = 0; i < PNP_MAX_PORT; i++) {
76 res = &dev->res.port_resource[i];
77 if (!(res->flags & IORESOURCE_UNSET))
78 dev_dbg(&dev->dev, " io %#llx-%#llx flags %#lx\n",
79 (unsigned long long) res->start,
80 (unsigned long long) res->end, res->flags);
81 }
82 for (i = 0; i < PNP_MAX_MEM; i++) {
83 res = &dev->res.mem_resource[i];
84 if (!(res->flags & IORESOURCE_UNSET))
85 dev_dbg(&dev->dev, " mem %#llx-%#llx flags %#lx\n",
86 (unsigned long long) res->start,
87 (unsigned long long) res->end, res->flags);
88 }
89#endif
90}