aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/resource.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:04 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:20 -0400
commitc1caf06ccfd3a4efd4b489f89bcdabd2362f31d0 (patch)
tree5571b9dc1b4b66c72ad64a406602d23112446f3e /drivers/pnp/resource.c
parentcdef6254e17e98f1071ce1bfc8f2a87997c855d0 (diff)
PNP: add debug output to option registration
Add debug output to resource option registration functions (enabled by CONFIG_PNP_DEBUG). This uses dev_printk, so I had to add pnp_dev arguments at the same time. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r--drivers/pnp/resource.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index e50ebcffb962..eee6d8eddcb4 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -53,6 +53,8 @@ struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev)
53 if (dev->independent) 53 if (dev->independent)
54 dev_err(&dev->dev, "independent resource already registered\n"); 54 dev_err(&dev->dev, "independent resource already registered\n");
55 dev->independent = option; 55 dev->independent = option;
56
57 dev_dbg(&dev->dev, "new independent option\n");
56 return option; 58 return option;
57} 59}
58 60
@@ -70,12 +72,18 @@ struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
70 parent->next = option; 72 parent->next = option;
71 } else 73 } else
72 dev->dependent = option; 74 dev->dependent = option;
75
76 dev_dbg(&dev->dev, "new dependent option (priority %#x)\n", priority);
73 return option; 77 return option;
74} 78}
75 79
76int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) 80int pnp_register_irq_resource(struct pnp_dev *dev, struct pnp_option *option,
81 struct pnp_irq *data)
77{ 82{
78 struct pnp_irq *ptr; 83 struct pnp_irq *ptr;
84#ifdef DEBUG
85 char buf[PNP_IRQ_NR]; /* hex-encoded, so this is overkill but safe */
86#endif
79 87
80 ptr = option->irq; 88 ptr = option->irq;
81 while (ptr && ptr->next) 89 while (ptr && ptr->next)
@@ -94,10 +102,17 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)
94 pcibios_penalize_isa_irq(i, 0); 102 pcibios_penalize_isa_irq(i, 0);
95 } 103 }
96#endif 104#endif
105
106#ifdef DEBUG
107 bitmap_scnprintf(buf, sizeof(buf), data->map, PNP_IRQ_NR);
108 dev_dbg(&dev->dev, " irq bitmask %s flags %#x\n", buf,
109 data->flags);
110#endif
97 return 0; 111 return 0;
98} 112}
99 113
100int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) 114int pnp_register_dma_resource(struct pnp_dev *dev, struct pnp_option *option,
115 struct pnp_dma *data)
101{ 116{
102 struct pnp_dma *ptr; 117 struct pnp_dma *ptr;
103 118
@@ -109,10 +124,13 @@ int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data)
109 else 124 else
110 option->dma = data; 125 option->dma = data;
111 126
127 dev_dbg(&dev->dev, " dma bitmask %#x flags %#x\n", data->map,
128 data->flags);
112 return 0; 129 return 0;
113} 130}
114 131
115int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) 132int pnp_register_port_resource(struct pnp_dev *dev, struct pnp_option *option,
133 struct pnp_port *data)
116{ 134{
117 struct pnp_port *ptr; 135 struct pnp_port *ptr;
118 136
@@ -124,10 +142,14 @@ int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data)
124 else 142 else
125 option->port = data; 143 option->port = data;
126 144
145 dev_dbg(&dev->dev, " io "
146 "min %#x max %#x align %d size %d flags %#x\n",
147 data->min, data->max, data->align, data->size, data->flags);
127 return 0; 148 return 0;
128} 149}
129 150
130int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) 151int pnp_register_mem_resource(struct pnp_dev *dev, struct pnp_option *option,
152 struct pnp_mem *data)
131{ 153{
132 struct pnp_mem *ptr; 154 struct pnp_mem *ptr;
133 155
@@ -138,6 +160,10 @@ int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data)
138 ptr->next = data; 160 ptr->next = data;
139 else 161 else
140 option->mem = data; 162 option->mem = data;
163
164 dev_dbg(&dev->dev, " mem "
165 "min %#x max %#x align %d size %d flags %#x\n",
166 data->min, data->max, data->align, data->size, data->flags);
141 return 0; 167 return 0;
142} 168}
143 169