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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 44bad73d8192..40041319657d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -541,6 +541,7 @@ void device_initialize(struct device *dev)
541 spin_lock_init(&dev->devres_lock); 541 spin_lock_init(&dev->devres_lock);
542 INIT_LIST_HEAD(&dev->devres_head); 542 INIT_LIST_HEAD(&dev->devres_head);
543 device_init_wakeup(dev, 0); 543 device_init_wakeup(dev, 0);
544 device_pm_init(dev);
544 set_dev_node(dev, -1); 545 set_dev_node(dev, -1);
545} 546}
546 547
@@ -897,9 +898,10 @@ int device_add(struct device *dev)
897 error = bus_add_device(dev); 898 error = bus_add_device(dev);
898 if (error) 899 if (error)
899 goto BusError; 900 goto BusError;
900 error = device_pm_add(dev); 901 error = dpm_sysfs_add(dev);
901 if (error) 902 if (error)
902 goto PMError; 903 goto DPMError;
904 device_pm_add(dev);
903 kobject_uevent(&dev->kobj, KOBJ_ADD); 905 kobject_uevent(&dev->kobj, KOBJ_ADD);
904 bus_attach_device(dev); 906 bus_attach_device(dev);
905 if (parent) 907 if (parent)
@@ -920,7 +922,7 @@ int device_add(struct device *dev)
920 Done: 922 Done:
921 put_device(dev); 923 put_device(dev);
922 return error; 924 return error;
923 PMError: 925 DPMError:
924 bus_remove_device(dev); 926 bus_remove_device(dev);
925 BusError: 927 BusError:
926 if (dev->bus) 928 if (dev->bus)
@@ -1007,6 +1009,7 @@ void device_del(struct device *dev)
1007 struct class_interface *class_intf; 1009 struct class_interface *class_intf;
1008 1010
1009 device_pm_remove(dev); 1011 device_pm_remove(dev);
1012 dpm_sysfs_remove(dev);
1010 if (parent) 1013 if (parent)
1011 klist_del(&dev->knode_parent); 1014 klist_del(&dev->knode_parent);
1012 if (MAJOR(dev->devt)) { 1015 if (MAJOR(dev->devt)) {