diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2007-10-17 02:31:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:04 -0400 |
commit | 348366b963e4e1462c8354827a9cb910aa865bf2 (patch) | |
tree | f5e668dbeef6c88aeb14cdb3e0a856ce8c45e7fb /drivers/pnp/core.c | |
parent | 36405e96c8090fc8fc05d56755645a5821c98992 (diff) |
PNP: add debug message for adding new device
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>
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r-- | drivers/pnp/core.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index d5964feb14d..7d366ca672d 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -125,9 +125,11 @@ int __pnp_add_device(struct pnp_dev *dev) | |||
125 | spin_unlock(&pnp_lock); | 125 | spin_unlock(&pnp_lock); |
126 | 126 | ||
127 | ret = device_register(&dev->dev); | 127 | ret = device_register(&dev->dev); |
128 | if (ret == 0) | 128 | if (ret) |
129 | pnp_interface_attach_device(dev); | 129 | return ret; |
130 | return ret; | 130 | |
131 | pnp_interface_attach_device(dev); | ||
132 | return 0; | ||
131 | } | 133 | } |
132 | 134 | ||
133 | /* | 135 | /* |
@@ -138,12 +140,30 @@ int __pnp_add_device(struct pnp_dev *dev) | |||
138 | */ | 140 | */ |
139 | int pnp_add_device(struct pnp_dev *dev) | 141 | int pnp_add_device(struct pnp_dev *dev) |
140 | { | 142 | { |
143 | int ret; | ||
144 | |||
141 | if (dev->card) | 145 | if (dev->card) |
142 | return -EINVAL; | 146 | return -EINVAL; |
147 | |||
143 | dev->dev.parent = &dev->protocol->dev; | 148 | dev->dev.parent = &dev->protocol->dev; |
144 | sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, | 149 | sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, |
145 | dev->number); | 150 | dev->number); |
146 | return __pnp_add_device(dev); | 151 | ret = __pnp_add_device(dev); |
152 | if (ret) | ||
153 | return ret; | ||
154 | |||
155 | #ifdef CONFIG_PNP_DEBUG | ||
156 | { | ||
157 | struct pnp_id *id; | ||
158 | |||
159 | dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs", | ||
160 | dev->protocol->name); | ||
161 | for (id = dev->id; id; id = id->next) | ||
162 | printk(" %s", id->id); | ||
163 | printk(" (%s)\n", dev->active ? "active" : "disabled"); | ||
164 | } | ||
165 | #endif | ||
166 | return 0; | ||
147 | } | 167 | } |
148 | 168 | ||
149 | void __pnp_remove_device(struct pnp_dev *dev) | 169 | void __pnp_remove_device(struct pnp_dev *dev) |