diff options
author | Len Brown <len.brown@intel.com> | 2008-10-22 23:28:43 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-22 23:28:43 -0400 |
commit | 4dff4e7f6cbcd2722b02dbb394ba87c4e05f8841 (patch) | |
tree | 2b80f6f9d3b5b1ff4600810c4a30917b2d66b7ab /drivers/pnp/core.c | |
parent | 5f50ef453dcb05115fc98f244b8f10bfacd4b8b7 (diff) | |
parent | ac88a8f3f7df04774b386ddaf586040adb819b58 (diff) |
Merge branch 'pnp-debug' into test
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) int pnp_add_device(struct pnp_dev *dev) { int ret; + char buf[128]; + int len = 0; + struct pnp_id *id; if (dev->card) return -EINVAL; @@ -193,17 +196,12 @@ int pnp_add_device(struct pnp_dev *dev) if (ret) return ret; -#ifdef CONFIG_PNP_DEBUG - { - struct pnp_id *id; + buf[0] = '\0'; + for (id = dev->id; id; id = id->next) + len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id); - dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs", - dev->protocol->name); - for (id = dev->id; id; id = id->next) - printk(" %s", id->id); - printk(" (%s)\n", dev->active ? "active" : "disabled"); - } -#endif + pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n", + dev->protocol->name, buf, dev->active ? "active" : "disabled"); return 0; } @@ -223,3 +221,14 @@ static int __init pnp_init(void) } subsys_initcall(pnp_init); + +int pnp_debug; + +#if defined(CONFIG_PNP_DEBUG_MESSAGES) +static int __init pnp_debug_setup(char *__unused) +{ + pnp_debug = 1; + return 1; +} +__setup("pnp.debug", pnp_debug_setup); +#endif |