Commit e10542c9 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] Trivial APM update part 1

This is the first of a series of patches I have got from Thomas Hood
that modify the apm code mainly for better self documentation.

This one does:

Variable "waiting_for_resume" is renamed 'ignore_sys_suspend'.
The reason for the change is that this flag variable is
employed in a manner analogous to that of other flag variables
named 'ignore ...'.  When the flag is set, the driver needs to
ignore further system suspends.  The driver does not "wait"
in the usual sense of that word.  The only sense in which the
driver waits is the sense in which it needs to continue to
ignore system suspends until certain events occur.  One such
event is a resume.  However, another such event is the vetoing
of the suspend request by a driver.  So it would be more
accurate to call the flag 'waiting_for_resume_or_suspend_reject'
or something like that.  But for the reason mentioned first,
an even better name is 'ignore_sys_suspend'.
parent f16fe773
......@@ -380,7 +380,7 @@ static int idle_period = DEFAULT_IDLE_PERIOD;
static int set_pm_idle;
static int suspends_pending;
static int standbys_pending;
static int waiting_for_resume;
static int ignore_sys_suspend;
static int ignore_normal_resume;
static int bounce_interval = DEFAULT_BOUNCE_INTERVAL;
......@@ -1200,7 +1200,7 @@ static int suspend(int vetoable)
if (apm_info.connection_version > 0x100)
apm_set_power_state(APM_STATE_REJECT);
err = -EBUSY;
waiting_for_resume = 0;
ignore_sys_suspend = 0;
printk(KERN_WARNING "apm: suspend was vetoed.\n");
goto out;
}
......@@ -1308,9 +1308,9 @@ static void check_events(void)
* sending a SUSPEND event until something else
* happens!
*/
if (waiting_for_resume)
if (ignore_sys_suspend)
return;
waiting_for_resume = 1;
ignore_sys_suspend = 1;
queue_event(event, NULL);
if (suspends_pending <= 0)
(void) suspend(1);
......@@ -1319,7 +1319,7 @@ static void check_events(void)
case APM_NORMAL_RESUME:
case APM_CRITICAL_RESUME:
case APM_STANDBY_RESUME:
waiting_for_resume = 0;
ignore_sys_suspend = 0;
last_resume = jiffies;
ignore_bounce = 1;
if ((event != APM_NORMAL_RESUME)
......
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