diff options
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r-- | drivers/pnp/core.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index a411582bcd72..521561509a75 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -185,6 +185,9 @@ int __pnp_add_device(struct pnp_dev *dev) | |||
185 | int pnp_add_device(struct pnp_dev *dev) | 185 | int pnp_add_device(struct pnp_dev *dev) |
186 | { | 186 | { |
187 | int ret; | 187 | int ret; |
188 | char buf[128]; | ||
189 | int len = 0; | ||
190 | struct pnp_id *id; | ||
188 | 191 | ||
189 | if (dev->card) | 192 | if (dev->card) |
190 | return -EINVAL; | 193 | return -EINVAL; |
@@ -193,17 +196,12 @@ int pnp_add_device(struct pnp_dev *dev) | |||
193 | if (ret) | 196 | if (ret) |
194 | return ret; | 197 | return ret; |
195 | 198 | ||
196 | #ifdef CONFIG_PNP_DEBUG | 199 | buf[0] = '\0'; |
197 | { | 200 | for (id = dev->id; id; id = id->next) |
198 | struct pnp_id *id; | 201 | len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id); |
199 | 202 | ||
200 | dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs", | 203 | pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n", |
201 | dev->protocol->name); | 204 | dev->protocol->name, buf, dev->active ? "active" : "disabled"); |
202 | for (id = dev->id; id; id = id->next) | ||
203 | printk(" %s", id->id); | ||
204 | printk(" (%s)\n", dev->active ? "active" : "disabled"); | ||
205 | } | ||
206 | #endif | ||
207 | return 0; | 205 | return 0; |
208 | } | 206 | } |
209 | 207 | ||
@@ -223,3 +221,14 @@ static int __init pnp_init(void) | |||
223 | } | 221 | } |
224 | 222 | ||
225 | subsys_initcall(pnp_init); | 223 | subsys_initcall(pnp_init); |
224 | |||
225 | int pnp_debug; | ||
226 | |||
227 | #if defined(CONFIG_PNP_DEBUG_MESSAGES) | ||
228 | static int __init pnp_debug_setup(char *__unused) | ||
229 | { | ||
230 | pnp_debug = 1; | ||
231 | return 1; | ||
232 | } | ||
233 | __setup("pnp.debug", pnp_debug_setup); | ||
234 | #endif | ||