Commit 790322ee authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] Trivial APM patch: set_system_power_state

Number 5 from Thomas Hood

This patch renames the static function "apm_set_power_state"
to 'set_system_power_state'.

Generally, the prefix 'apm_' is required to prevent external
name collisions on exported functions.  This is a static function,
so the prefix isn't required for that purpose.  The prefix might
also indicate that this function has something particularly
to do with the apm subsystem; but that's not the case here.  This
function is simply a wrapper for set_power_state(), inserting the
argument which sets the power state for the whole system.
My main motivation for wanting to change this name is clearly
to indicate the difference between this function and
set_power_state().  Also, I would like to export set_power_state()
someday in the future, but this is a separate issue.
parent 7efc9a0f
...@@ -724,13 +724,13 @@ static int set_power_state(u_short what, u_short state) ...@@ -724,13 +724,13 @@ static int set_power_state(u_short what, u_short state)
} }
/** /**
* apm_set_power_state - set system wide power state * set_system_power_state - set system wide power state
* @state: which state to enter * @state: which state to enter
* *
* Transition the entire system into a new APM power state. * Transition the entire system into a new APM power state.
*/ */
static int apm_set_power_state(u_short state) static int set_system_power_state(u_short state)
{ {
return set_power_state(APM_DEVICE_ALL, state); return set_power_state(APM_DEVICE_ALL, state);
} }
...@@ -912,7 +912,7 @@ static void apm_power_off(void) ...@@ -912,7 +912,7 @@ static void apm_power_off(void)
if (apm_info.realmode_power_off) if (apm_info.realmode_power_off)
machine_real_restart(po_bios_call, sizeof(po_bios_call)); machine_real_restart(po_bios_call, sizeof(po_bios_call));
else else
(void) apm_set_power_state(APM_STATE_OFF); (void) set_system_power_state(APM_STATE_OFF);
} }
/** /**
...@@ -1198,7 +1198,7 @@ static int suspend(int vetoable) ...@@ -1198,7 +1198,7 @@ static int suspend(int vetoable)
/* Vetoed */ /* Vetoed */
if (vetoable) { if (vetoable) {
if (apm_info.connection_version > 0x100) if (apm_info.connection_version > 0x100)
apm_set_power_state(APM_STATE_REJECT); set_system_power_state(APM_STATE_REJECT);
err = -EBUSY; err = -EBUSY;
ignore_sys_suspend = 0; ignore_sys_suspend = 0;
printk(KERN_WARNING "apm: suspend was vetoed.\n"); printk(KERN_WARNING "apm: suspend was vetoed.\n");
...@@ -1208,7 +1208,7 @@ static int suspend(int vetoable) ...@@ -1208,7 +1208,7 @@ static int suspend(int vetoable)
} }
get_time_diff(); get_time_diff();
cli(); cli();
err = apm_set_power_state(APM_STATE_SUSPEND); err = set_system_power_state(APM_STATE_SUSPEND);
reinit_timer(); reinit_timer();
set_time(); set_time();
ignore_normal_resume = 1; ignore_normal_resume = 1;
...@@ -1237,7 +1237,7 @@ static void standby(void) ...@@ -1237,7 +1237,7 @@ static void standby(void)
/* If needed, notify drivers here */ /* If needed, notify drivers here */
get_time_diff(); get_time_diff();
err = apm_set_power_state(APM_STATE_STANDBY); err = set_system_power_state(APM_STATE_STANDBY);
if ((err != APM_SUCCESS) && (err != APM_NO_ERROR)) if ((err != APM_SUCCESS) && (err != APM_NO_ERROR))
apm_error("standby", err); apm_error("standby", err);
} }
...@@ -1291,13 +1291,13 @@ static void check_events(void) ...@@ -1291,13 +1291,13 @@ static void check_events(void)
case APM_USER_SUSPEND: case APM_USER_SUSPEND:
#ifdef CONFIG_APM_IGNORE_USER_SUSPEND #ifdef CONFIG_APM_IGNORE_USER_SUSPEND
if (apm_info.connection_version > 0x100) if (apm_info.connection_version > 0x100)
apm_set_power_state(APM_STATE_REJECT); set_system_power_state(APM_STATE_REJECT);
break; break;
#endif #endif
case APM_SYS_SUSPEND: case APM_SYS_SUSPEND:
if (ignore_bounce) { if (ignore_bounce) {
if (apm_info.connection_version > 0x100) if (apm_info.connection_version > 0x100)
apm_set_power_state(APM_STATE_REJECT); set_system_power_state(APM_STATE_REJECT);
break; break;
} }
/* /*
...@@ -1363,7 +1363,7 @@ static void apm_event_handler(void) ...@@ -1363,7 +1363,7 @@ static void apm_event_handler(void)
pending_count = 4; pending_count = 4;
if (debug) if (debug)
printk(KERN_DEBUG "apm: setting state busy\n"); printk(KERN_DEBUG "apm: setting state busy\n");
err = apm_set_power_state(APM_STATE_BUSY); err = set_system_power_state(APM_STATE_BUSY);
if (err) if (err)
apm_error("busy", err); apm_error("busy", err);
} }
......
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