/**
- * device_pm_resume - Restore state of each device in system.
+ * device_resume - Restore state of each device in system.
*
* Restore normal device state and release the dpm_sem.
*/
-void device_pm_resume(void)
+void device_resume(void)
{
while(!list_empty(&dpm_off)) {
struct list_head * entry = dpm_off.next;
up(&dpm_sem);
}
+EXPORT_SYMBOL(device_resume);
+
/**
* device_power_up_irq - Power on some devices.
* Called with interrupts disabled.
*/
-void device_pm_power_up(void)
+void device_power_up(void)
{
sysdev_resume();
dpm_power_up();
}
-/**
- * device_resume - resume all the devices in the system
- * @level: stage of resume process we're at
- *
- * This function is deprecated, and should be replaced with appropriate
- * calls to device_pm_power_up() and device_pm_resume() above.
- */
-
-void device_resume(u32 level)
-{
+EXPORT_SYMBOL(device_power_up);
- printk("%s is deprecated. Called from:\n",__FUNCTION__);
- dump_stack();
-}
-EXPORT_SYMBOL(device_resume);
/**
- * device_pm_suspend - Save state and stop all devices in system.
+ * device_suspend - Save state and stop all devices in system.
* @state: Power state to put each device in.
*
* Walk the dpm_active list, call ->suspend() for each device, and move
* the device to the dpm_off list. If it returns -EAGAIN, we move it to
* the dpm_off_irq list. If we get a different error, try and back out.
*
- * If we hit a failure with any of the devices, call device_pm_resume()
+ * If we hit a failure with any of the devices, call device_resume()
* above to bring the suspended devices back to life.
*
* Note this function leaves dpm_sem held to
* b) prevent other PM operations from happening after we've begun.
* c) make sure we're exclusive when we disable interrupts.
*
- * device_pm_resume() will release dpm_sem after restoring state to
+ * device_resume() will release dpm_sem after restoring state to
* all devices (as will this on error). You must call it once you've
- * called device_pm_suspend().
+ * called device_suspend().
*/
-int device_pm_suspend(u32 state)
+int device_suspend(u32 state)
{
int error = 0;
Done:
return error;
Error:
- device_pm_resume();
+ device_resume();
goto Done;
}
+EXPORT_SYMBOL(device_suspend);
+
/**
- * device_pm_power_down - Shut down special devices.
+ * device_power_down - Shut down special devices.
* @state: Power state to enter.
*
* Walk the dpm_off_irq list, calling ->power_down() for each device that
* done, power down system devices.
*/
-int device_pm_power_down(u32 state)
+int device_power_down(u32 state)
{
int error = 0;
struct device * dev;
goto Done;
}
+EXPORT_SYMBOL(device_power_down);
-/**
- * device_suspend - suspend all devices on the device ree
- * @state: state we're entering
- * @level: Stage of suspend sequence we're in.
- *
- *
- * This function is deprecated. Calls should be replaced with
- * appropriate calls to device_pm_suspend() and device_pm_power_down().
- */
-
-int device_suspend(u32 state, u32 level)
-{
-
- printk("%s Called from:\n",__FUNCTION__);
- dump_stack();
- return -EFAULT;
-}
-
-EXPORT_SYMBOL(device_suspend);
extern void device_pm_set_parent(struct device * dev, struct device * parent);
-extern int device_pm_suspend(u32 state);
-extern int device_pm_power_down(u32 state);
-extern void device_pm_power_up(void);
-extern void device_pm_resume(void);
+extern int device_suspend(u32 state);
+extern int device_power_down(u32 state);
+extern void device_power_up(void);
+extern void device_resume(void);
#endif /* __KERNEL__ */
return -EPERM;
local_irq_save(flags);
- if ((error = device_pm_power_down(PM_SUSPEND_STANDBY)))
+ if ((error = device_power_down(PM_SUSPEND_STANDBY)))
goto Done;
error = pm_ops->enter(PM_SUSPEND_STANDBY);
local_irq_restore(flags);
- device_pm_power_up();
+ device_power_up();
Done:
return error;
}
return -EPERM;
local_irq_save(flags);
- if ((error = device_pm_power_down(PM_SUSPEND_STANDBY)))
+ if ((error = device_power_down(PM_SUSPEND_STANDBY)))
goto Done;
error = pm_ops->enter(PM_SUSPEND_STANDBY);
local_irq_restore(flags);
- device_pm_power_up();
+ device_power_up();
Done:
return error;
}
int error = 0;
local_irq_save(flags);
- device_pm_power_down(PM_SUSPEND_DISK);
+ device_power_down(PM_SUSPEND_DISK);
switch(mode) {
case PM_DISK_PLATFORM:
error = pm_ops->enter(PM_SUSPEND_DISK);
if (error) {
- device_pm_power_up();
+ device_power_up();
local_irq_restore(flags);
return error;
}
if (state == PM_SUSPEND_DISK)
free_some_memory();
- if ((error = device_pm_suspend(state)))
+ if ((error = device_suspend(state)))
goto Finish;
return 0;
static void suspend_finish(u32 state)
{
- device_pm_resume();
+ device_resume();
if (pm_ops && pm_ops->finish)
pm_ops->finish(state);
thaw_processes();
-/*
+'/*
* linux/kernel/suspend.c
*
* This file is to realize architecture-independent
{
int error;
- device_pm_resume();
+ device_resume();
lock_swapdevices();
error = write_suspend_image();