]> err.no Git - linux-2.6/blobdiff - drivers/base/power/main.c
Merge branch 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6] / drivers / base / power / main.c
index 93a146940b916975149b32be509151c45461b828..45cc3d9eacb874db52f663fe4cc3dea83b41d92c 100644 (file)
 LIST_HEAD(dpm_active);
 static LIST_HEAD(dpm_off);
 static LIST_HEAD(dpm_off_irq);
-static LIST_HEAD(dpm_destroy);
 
 static DEFINE_MUTEX(dpm_list_mtx);
 
 /* 'true' if all devices have been suspended, protected by dpm_list_mtx */
 static bool all_sleeping;
 
-int (*platform_enable_wakeup)(struct device *dev, int is_on);
-
 /**
  *     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)
 {
-       int error = 0;
+       int error;
 
        pr_debug("PM: Adding info for %s:%s\n",
                 dev->bus ? dev->bus->name : "No Bus",
@@ -73,18 +70,15 @@ int device_pm_add(struct device *dev)
        mutex_lock(&dpm_list_mtx);
        if ((dev->parent && dev->parent->power.sleeping) || all_sleeping) {
                if (dev->parent->power.sleeping)
-                       dev_warn(dev,
-                               "parent %s is sleeping, will not add\n",
+                       dev_warn(dev, "parent %s is sleeping\n",
                                dev->parent->bus_id);
                else
-                       dev_warn(dev, "devices are sleeping, will not add\n");
+                       dev_warn(dev, "all devices are sleeping\n");
                WARN_ON(true);
-               error = -EBUSY;
-       } else {
-               error = dpm_sysfs_add(dev);
-               if (!error)
-                       list_add_tail(&dev->power.entry, &dpm_active);
        }
+       error = dpm_sysfs_add(dev);
+       if (!error)
+               list_add_tail(&dev->power.entry, &dpm_active);
        mutex_unlock(&dpm_list_mtx);
        return error;
 }
@@ -106,24 +100,6 @@ void device_pm_remove(struct device *dev)
        mutex_unlock(&dpm_list_mtx);
 }
 
-/**
- *     device_pm_schedule_removal - schedule the removal of a suspended device
- *     @dev:   Device to destroy
- *
- *     Moves the device to the dpm_destroy list for further processing by
- *     unregister_dropped_devices().
- */
-void device_pm_schedule_removal(struct device *dev)
-{
-       pr_debug("PM: Preparing for removal: %s:%s\n",
-               dev->bus ? dev->bus->name : "No Bus",
-               kobject_name(&dev->kobj));
-       mutex_lock(&dpm_list_mtx);
-       list_move_tail(&dev->power.entry, &dpm_destroy);
-       mutex_unlock(&dpm_list_mtx);
-}
-EXPORT_SYMBOL_GPL(device_pm_schedule_removal);
-
 /*------------------------- Resume routines -------------------------*/
 
 /**
@@ -247,26 +223,6 @@ static void dpm_resume(void)
        mutex_unlock(&dpm_list_mtx);
 }
 
-/**
- *     unregister_dropped_devices - Unregister devices scheduled for removal
- *
- *     Unregister all devices on the dpm_destroy list.
- */
-static void unregister_dropped_devices(void)
-{
-       mutex_lock(&dpm_list_mtx);
-       while (!list_empty(&dpm_destroy)) {
-               struct list_head *entry = dpm_destroy.next;
-               struct device *dev = to_device(entry);
-
-               mutex_unlock(&dpm_list_mtx);
-               /* This also removes the device from the list */
-               device_unregister(dev);
-               mutex_lock(&dpm_list_mtx);
-       }
-       mutex_unlock(&dpm_list_mtx);
-}
-
 /**
  *     device_resume - Restore state of each device in system.
  *
@@ -277,7 +233,6 @@ void device_resume(void)
 {
        might_sleep();
        dpm_resume();
-       unregister_dropped_devices();
 }
 EXPORT_SYMBOL_GPL(device_resume);
 
@@ -463,7 +418,7 @@ void __suspend_report_result(const char *function, void *fn, int ret)
 {
        if (ret) {
                printk(KERN_ERR "%s(): ", function);
-               print_fn_descriptor_symbol("%s() returns ", (unsigned long)fn);
+               print_fn_descriptor_symbol("%s returns ", fn);
                printk("%d\n", ret);
        }
 }