aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r--drivers/pnp/core.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 817fe626e15..16c01c6fa7c 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -177,6 +177,9 @@ int __pnp_add_device(struct pnp_dev *dev)
177int pnp_add_device(struct pnp_dev *dev) 177int pnp_add_device(struct pnp_dev *dev)
178{ 178{
179 int ret; 179 int ret;
180 char buf[128];
181 int len = 0;
182 struct pnp_id *id;
180 183
181 if (dev->card) 184 if (dev->card)
182 return -EINVAL; 185 return -EINVAL;
@@ -185,17 +188,12 @@ int pnp_add_device(struct pnp_dev *dev)
185 if (ret) 188 if (ret)
186 return ret; 189 return ret;
187 190
188#ifdef CONFIG_PNP_DEBUG 191 buf[0] = '\0';
189 { 192 for (id = dev->id; id; id = id->next)
190 struct pnp_id *id; 193 len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id);
191 194
192 dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs", 195 pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n",
193 dev->protocol->name); 196 dev->protocol->name, buf, dev->active ? "active" : "disabled");
194 for (id = dev->id; id; id = id->next)
195 printk(" %s", id->id);
196 printk(" (%s)\n", dev->active ? "active" : "disabled");
197 }
198#endif
199 return 0; 197 return 0;
200} 198}
201 199
@@ -214,3 +212,14 @@ static int __init pnp_init(void)
214} 212}
215 213
216subsys_initcall(pnp_init); 214subsys_initcall(pnp_init);
215
216int pnp_debug;
217
218#if defined(CONFIG_PNP_DEBUG_MESSAGES)
219static int __init pnp_debug_setup(char *__unused)
220{
221 pnp_debug = 1;
222 return 1;
223}
224__setup("pnp.debug", pnp_debug_setup);
225#endif