From: Stephen Rothwell Date: Tue, 12 Mar 2002 04:57:38 +0000 (-0800) Subject: [PATCH] Trivial APM patch: set_system_power_state X-Git-Tag: v2.5.7-pre1~14 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=790322eef0cef9cc1c9f2cbb14b55a8abd63bcfa;p=history.git [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. --- diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 90dedc85d208..8cfcecf85888 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -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 * * 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); } @@ -912,7 +912,7 @@ static void apm_power_off(void) if (apm_info.realmode_power_off) machine_real_restart(po_bios_call, sizeof(po_bios_call)); 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) /* Vetoed */ if (vetoable) { if (apm_info.connection_version > 0x100) - apm_set_power_state(APM_STATE_REJECT); + set_system_power_state(APM_STATE_REJECT); err = -EBUSY; ignore_sys_suspend = 0; printk(KERN_WARNING "apm: suspend was vetoed.\n"); @@ -1208,7 +1208,7 @@ static int suspend(int vetoable) } get_time_diff(); cli(); - err = apm_set_power_state(APM_STATE_SUSPEND); + err = set_system_power_state(APM_STATE_SUSPEND); reinit_timer(); set_time(); ignore_normal_resume = 1; @@ -1237,7 +1237,7 @@ static void standby(void) /* If needed, notify drivers here */ 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)) apm_error("standby", err); } @@ -1291,13 +1291,13 @@ static void check_events(void) case APM_USER_SUSPEND: #ifdef CONFIG_APM_IGNORE_USER_SUSPEND if (apm_info.connection_version > 0x100) - apm_set_power_state(APM_STATE_REJECT); + set_system_power_state(APM_STATE_REJECT); break; #endif case APM_SYS_SUSPEND: if (ignore_bounce) { if (apm_info.connection_version > 0x100) - apm_set_power_state(APM_STATE_REJECT); + set_system_power_state(APM_STATE_REJECT); break; } /* @@ -1363,7 +1363,7 @@ static void apm_event_handler(void) pending_count = 4; if (debug) 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) apm_error("busy", err); }