Commit 4ebf0c49 authored by Patrick Mochel's avatar Patrick Mochel Committed by Patrick Mochel

[Power Mgmt] Make sure we shutdown devices on shutdown and reboot..

parent 11700b3c
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/device.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/fs.h> #include <linux/fs.h>
#include "power.h" #include "power.h"
...@@ -46,16 +47,18 @@ static int power_down(u32 mode) ...@@ -46,16 +47,18 @@ static int power_down(u32 mode)
int error = 0; int error = 0;
local_irq_save(flags); local_irq_save(flags);
device_power_down(PM_SUSPEND_DISK);
switch(mode) { switch(mode) {
case PM_DISK_PLATFORM: case PM_DISK_PLATFORM:
device_power_down(PM_SUSPEND_DISK);
error = pm_ops->enter(PM_SUSPEND_DISK); error = pm_ops->enter(PM_SUSPEND_DISK);
break; break;
case PM_DISK_SHUTDOWN: case PM_DISK_SHUTDOWN:
printk("Powering off system\n"); printk("Powering off system\n");
device_shutdown();
machine_power_off(); machine_power_off();
break; break;
case PM_DISK_REBOOT: case PM_DISK_REBOOT:
device_shutdown();
machine_restart(NULL); machine_restart(NULL);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment