Pull bugfix into test branch
authorLen Brown <len.brown@intel.com>
Sat, 16 Dec 2006 06:01:18 +0000 (01:01 -0500)
committerLen Brown <len.brown@intel.com>
Sat, 16 Dec 2006 06:01:18 +0000 (01:01 -0500)
Conflicts:

kernel/power/disk.c

1  2 
drivers/acpi/dock.c
kernel/power/disk.c
kernel/power/main.c

index 215f5b30a1f1993f5fa2dab51be452d6e90b3e92,c7df2a1ea9d75e7787ec9cd244a41559ddda41f5..54ce12ab43d786680c275a3629de0227b1a13df1
@@@ -681,33 -625,9 +681,33 @@@ static int dock_add(acpi_handle handle
        INIT_LIST_HEAD(&dock_station->dependent_devices);
        INIT_LIST_HEAD(&dock_station->hotplug_devices);
        spin_lock_init(&dock_station->dd_lock);
-       spin_lock_init(&dock_station->hp_lock);
+       mutex_init(&dock_station->hp_lock);
        ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list);
  
 +      /* initialize platform device stuff */
 +      dock_device.name = dock_device_name;
 +      ret = platform_device_register(&dock_device);
 +      if (ret) {
 +              printk(KERN_ERR PREFIX "Error %d registering dock device\n", ret);
 +              kfree(dock_station);
 +              return ret;
 +      }
 +      ret = device_create_file(&dock_device.dev, &dev_attr_docked);
 +      if (ret) {
 +              printk("Error %d adding sysfs file\n", ret);
 +              platform_device_unregister(&dock_device);
 +              kfree(dock_station);
 +              return ret;
 +      }
 +      ret = device_create_file(&dock_device.dev, &dev_attr_undock);
 +      if (ret) {
 +              printk("Error %d adding sysfs file\n", ret);
 +              device_remove_file(&dock_device.dev, &dev_attr_docked);
 +              platform_device_unregister(&dock_device);
 +              kfree(dock_station);
 +              return ret;
 +      }
 +
        /* Find dependent devices */
        acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX, find_dock_devices, dock_station,
index 0b00f56c2ad0ad369fdaa42d40e24c6f56720881,ae6bbc903b7d1993577375a7b7e77faf184c33a9..88fc5d7ac737402c18db0306049b5873effeed55
@@@ -58,11 -40,15 +58,13 @@@ static inline int platform_prepare(void
  
  static void power_down(suspend_disk_method_t mode)
  {
 -      int error = 0;
 -
        switch(mode) {
        case PM_DISK_PLATFORM:
-               kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
-               pm_ops->enter(PM_SUSPEND_DISK);
-               break;
+               if (pm_ops && pm_ops->enter) {
+                       kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
 -                      error = pm_ops->enter(PM_SUSPEND_DISK);
++                      pm_ops->enter(PM_SUSPEND_DISK);
+                       break;
+               }
        case PM_DISK_SHUTDOWN:
                kernel_power_off();
                break;
index 500eb87f643dd9ff56d08079a29c506e7140b777,1210961a5aa7de09561fa06a33b6d7dd5846d3fe..ff3a6182f5f0df3fb479cbd56092dd0ee8e1ff2e
  /*This is just an arbitrary number */
  #define FREE_PAGE_NUMBER (100)
  
 -DECLARE_MUTEX(pm_sem);
 +DEFINE_MUTEX(pm_mutex);
  
  struct pm_ops *pm_ops;
- suspend_disk_method_t pm_disk_mode = PM_DISK_SHUTDOWN;
+ suspend_disk_method_t pm_disk_mode = PM_DISK_PLATFORM;
  
  /**
   *    pm_set_ops - Set the global power method table.