aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 268a9c8d168b..fbc223486f81 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -31,8 +31,6 @@ int (*platform_notify_remove)(struct device * dev) = NULL;
31#define to_dev(obj) container_of(obj, struct device, kobj) 31#define to_dev(obj) container_of(obj, struct device, kobj)
32#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr) 32#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
33 33
34extern struct attribute * dev_default_attrs[];
35
36static ssize_t 34static ssize_t
37dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf) 35dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
38{ 36{
@@ -89,7 +87,6 @@ static void device_release(struct kobject * kobj)
89static struct kobj_type ktype_device = { 87static struct kobj_type ktype_device = {
90 .release = device_release, 88 .release = device_release,
91 .sysfs_ops = &dev_sysfs_ops, 89 .sysfs_ops = &dev_sysfs_ops,
92 .default_attrs = dev_default_attrs,
93}; 90};
94 91
95 92
@@ -248,6 +245,7 @@ int device_add(struct device *dev)
248 245
249 if ((error = kobject_add(&dev->kobj))) 246 if ((error = kobject_add(&dev->kobj)))
250 goto Error; 247 goto Error;
248 kobject_hotplug(&dev->kobj, KOBJ_ADD);
251 if ((error = device_pm_add(dev))) 249 if ((error = device_pm_add(dev)))
252 goto PMError; 250 goto PMError;
253 if ((error = bus_add_device(dev))) 251 if ((error = bus_add_device(dev)))
@@ -260,14 +258,13 @@ int device_add(struct device *dev)
260 /* notify platform of device entry */ 258 /* notify platform of device entry */
261 if (platform_notify) 259 if (platform_notify)
262 platform_notify(dev); 260 platform_notify(dev);
263
264 kobject_hotplug(&dev->kobj, KOBJ_ADD);
265 Done: 261 Done:
266 put_device(dev); 262 put_device(dev);
267 return error; 263 return error;
268 BusError: 264 BusError:
269 device_pm_remove(dev); 265 device_pm_remove(dev);
270 PMError: 266 PMError:
267 kobject_hotplug(&dev->kobj, KOBJ_REMOVE);
271 kobject_del(&dev->kobj); 268 kobject_del(&dev->kobj);
272 Error: 269 Error:
273 if (parent) 270 if (parent)