Commit 9234878a authored by Patrick Mochel's avatar Patrick Mochel

[power] Fixup device suspend/resume function names.

- Revert names of functions back to device_{suspend,resume} since at least 
  APM are still using them.
parent 12770fac
......@@ -29,12 +29,12 @@ int resume_device(struct device * dev)
/**
* 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;
......@@ -46,6 +46,8 @@ void device_pm_resume(void)
up(&dpm_sem);
}
EXPORT_SYMBOL(device_resume);
/**
* device_power_up_irq - Power on some devices.
......@@ -77,25 +79,12 @@ void dpm_power_up(void)
* 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.
*/
EXPORT_SYMBOL(device_power_up);
void device_resume(u32 level)
{
printk("%s is deprecated. Called from:\n",__FUNCTION__);
dump_stack();
}
EXPORT_SYMBOL(device_resume);
......@@ -54,7 +54,7 @@ int suspend_device(struct device * dev, u32 state)
/**
* 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
......@@ -63,7 +63,7 @@ int suspend_device(struct device * dev, u32 state)
* 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
......@@ -71,12 +71,12 @@ int suspend_device(struct device * dev, u32 state)
* 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;
......@@ -90,13 +90,15 @@ int device_pm_suspend(u32 state)
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
......@@ -104,7 +106,7 @@ int device_pm_suspend(u32 state)
* done, power down system devices.
*/
int device_pm_power_down(u32 state)
int device_power_down(u32 state)
{
int error = 0;
struct device * dev;
......@@ -124,23 +126,5 @@ int device_pm_power_down(u32 state)
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);
......@@ -240,10 +240,10 @@ struct dev_pm_info {
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__ */
......
......@@ -66,11 +66,11 @@ static int pm_suspend_standby(void)
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;
}
......@@ -92,11 +92,11 @@ static int pm_suspend_mem(void)
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;
}
......@@ -118,12 +118,12 @@ static int power_down(u32 mode)
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;
}
......@@ -245,7 +245,7 @@ static int suspend_prepare(u32 state)
if (state == PM_SUSPEND_DISK)
free_some_memory();
if ((error = device_pm_suspend(state)))
if ((error = device_suspend(state)))
goto Finish;
return 0;
......@@ -271,7 +271,7 @@ static int suspend_prepare(u32 state)
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
......@@ -492,7 +492,7 @@ static int suspend_save_image(void)
{
int error;
device_pm_resume();
device_resume();
lock_swapdevices();
error = write_suspend_image();
......
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