aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/core.c28
-rw-r--r--drivers/pnp/pnpacpi/core.c1
2 files changed, 24 insertions, 5 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index d5964feb14de..7d366ca672d3 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 */
139int pnp_add_device(struct pnp_dev *dev) 141int 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
149void __pnp_remove_device(struct pnp_dev *dev) 169void __pnp_remove_device(struct pnp_dev *dev)
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index e6a2a9fc7f0a..dada89906314 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -171,7 +171,6 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
171 is_exclusive_device(device)) 171 is_exclusive_device(device))
172 return 0; 172 return 0;
173 173
174 pnp_dbg("ACPI device : hid %s", acpi_device_hid(device));
175 dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL); 174 dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL);
176 if (!dev) { 175 if (!dev) {
177 pnp_err("Out of memory"); 176 pnp_err("Out of memory");