]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/base/power/main.c
PM: Remove WARN_ON from device_pm_add
[linux-2.6-omap-h63xx.git] / drivers / base / power / main.c
index 3250c5257b748286cfec992558a7590f0ab915e9..273a944d4040e861afa6a1ea6c601264eec6c4a7 100644 (file)
@@ -67,20 +67,16 @@ void device_pm_unlock(void)
  *     device_pm_add - add a device to the list of active devices
  *     @dev:   Device to be added to the list
  */
-int device_pm_add(struct device *dev)
+void device_pm_add(struct device *dev)
 {
-       int error;
-
        pr_debug("PM: Adding info for %s:%s\n",
                 dev->bus ? dev->bus->name : "No Bus",
                 kobject_name(&dev->kobj));
        mutex_lock(&dpm_list_mtx);
        if (dev->parent) {
-               if (dev->parent->power.status >= DPM_SUSPENDING) {
-                       dev_warn(dev, "parent %s is sleeping, will not add\n",
+               if (dev->parent->power.status >= DPM_SUSPENDING)
+                       dev_warn(dev, "parent %s should not be sleeping\n",
                                dev->parent->bus_id);
-                       WARN_ON(true);
-               }
        } else if (transition_started) {
                /*
                 * We refuse to register parentless devices while a PM
@@ -89,13 +85,9 @@ int device_pm_add(struct device *dev)
                 */
                WARN_ON(true);
        }
-       error = dpm_sysfs_add(dev);
-       if (!error) {
-               dev->power.status = DPM_ON;
-               list_add_tail(&dev->power.entry, &dpm_list);
-       }
+
+       list_add_tail(&dev->power.entry, &dpm_list);
        mutex_unlock(&dpm_list_mtx);
-       return error;
 }
 
 /**
@@ -110,7 +102,6 @@ void device_pm_remove(struct device *dev)
                 dev->bus ? dev->bus->name : "No Bus",
                 kobject_name(&dev->kobj));
        mutex_lock(&dpm_list_mtx);
-       dpm_sysfs_remove(dev);
        list_del_init(&dev->power.entry);
        mutex_unlock(&dpm_list_mtx);
 }