]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PNP: add debug message for adding new device
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Wed, 17 Oct 2007 06:31:12 +0000 (23:31 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:43:04 +0000 (08:43 -0700)
Add PNP debug message when adding a device, remove similar PNPACPI message
with less information.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/pnp/core.c
drivers/pnp/pnpacpi/core.c

index d5964feb14de56d5c1dc5b7c9c1df1e8f9f447d0..7d366ca672d34ea7b6d07afa04fbcfbec849ad10 100644 (file)
@@ -125,9 +125,11 @@ int __pnp_add_device(struct pnp_dev *dev)
        spin_unlock(&pnp_lock);
 
        ret = device_register(&dev->dev);
-       if (ret == 0)
-               pnp_interface_attach_device(dev);
-       return ret;
+       if (ret)
+               return ret;
+
+       pnp_interface_attach_device(dev);
+       return 0;
 }
 
 /*
@@ -138,12 +140,30 @@ int __pnp_add_device(struct pnp_dev *dev)
  */
 int pnp_add_device(struct pnp_dev *dev)
 {
+       int ret;
+
        if (dev->card)
                return -EINVAL;
+
        dev->dev.parent = &dev->protocol->dev;
        sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
                dev->number);
-       return __pnp_add_device(dev);
+       ret = __pnp_add_device(dev);
+       if (ret)
+               return ret;
+
+#ifdef CONFIG_PNP_DEBUG
+       {
+               struct pnp_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
+       return 0;
 }
 
 void __pnp_remove_device(struct pnp_dev *dev)
index e6a2a9fc7f0ada0f27283fc9986c198719ab1fea..dada89906314c7103b89b6e96a071afe3900d74d 100644 (file)
@@ -171,7 +171,6 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
            is_exclusive_device(device))
                return 0;
 
-       pnp_dbg("ACPI device : hid %s", acpi_device_hid(device));
        dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL);
        if (!dev) {
                pnp_err("Out of memory");