aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-04-08 19:40:38 -0400
committerLen Brown <len.brown@intel.com>2010-05-28 23:36:06 -0400
commitfe955682d2153b35dffcf1673dff0491096a3f0a (patch)
treefb2e04c48bb89e19b6b2c274daa817b3cf09bd4e /drivers/acpi/ec.c
parentd5a64513c6a171262082c250592c062e97a2c693 (diff)
ACPI / EC / PM: Fix names of functions that block/unblock EC transactions
The names of the functions used for blocking/unblocking EC transactions during suspend/hibernation suggest that the transactions are suspended and resumed by them, while in fact they are disabled and enabled. Rename the functions (and the flag used by them) to better reflect what they really do. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 2c2b73a2a7c2..3f01f065b533 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -79,7 +79,7 @@ enum {
79 EC_FLAGS_GPE_STORM, /* GPE storm detected */ 79 EC_FLAGS_GPE_STORM, /* GPE storm detected */
80 EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and 80 EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and
81 * OpReg are installed */ 81 * OpReg are installed */
82 EC_FLAGS_FROZEN, /* Transactions are suspended */ 82 EC_FLAGS_BLOCKED, /* Transactions are blocked */
83}; 83};
84 84
85/* If we find an EC via the ECDT, we need to keep a ptr to its context */ 85/* If we find an EC via the ECDT, we need to keep a ptr to its context */
@@ -293,7 +293,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
293 if (t->rdata) 293 if (t->rdata)
294 memset(t->rdata, 0, t->rlen); 294 memset(t->rdata, 0, t->rlen);
295 mutex_lock(&ec->lock); 295 mutex_lock(&ec->lock);
296 if (test_bit(EC_FLAGS_FROZEN, &ec->flags)) { 296 if (test_bit(EC_FLAGS_BLOCKED, &ec->flags)) {
297 status = -EINVAL; 297 status = -EINVAL;
298 goto unlock; 298 goto unlock;
299 } 299 }
@@ -459,7 +459,7 @@ int ec_transaction(u8 command,
459 459
460EXPORT_SYMBOL(ec_transaction); 460EXPORT_SYMBOL(ec_transaction);
461 461
462void acpi_ec_suspend_transactions(void) 462void acpi_ec_block_transactions(void)
463{ 463{
464 struct acpi_ec *ec = first_ec; 464 struct acpi_ec *ec = first_ec;
465 465
@@ -468,11 +468,11 @@ void acpi_ec_suspend_transactions(void)
468 468
469 mutex_lock(&ec->lock); 469 mutex_lock(&ec->lock);
470 /* Prevent transactions from being carried out */ 470 /* Prevent transactions from being carried out */
471 set_bit(EC_FLAGS_FROZEN, &ec->flags); 471 set_bit(EC_FLAGS_BLOCKED, &ec->flags);
472 mutex_unlock(&ec->lock); 472 mutex_unlock(&ec->lock);
473} 473}
474 474
475void acpi_ec_resume_transactions(void) 475void acpi_ec_unblock_transactions(void)
476{ 476{
477 struct acpi_ec *ec = first_ec; 477 struct acpi_ec *ec = first_ec;
478 478
@@ -481,18 +481,18 @@ void acpi_ec_resume_transactions(void)
481 481
482 mutex_lock(&ec->lock); 482 mutex_lock(&ec->lock);
483 /* Allow transactions to be carried out again */ 483 /* Allow transactions to be carried out again */
484 clear_bit(EC_FLAGS_FROZEN, &ec->flags); 484 clear_bit(EC_FLAGS_BLOCKED, &ec->flags);
485 mutex_unlock(&ec->lock); 485 mutex_unlock(&ec->lock);
486} 486}
487 487
488void acpi_ec_resume_transactions_early(void) 488void acpi_ec_unblock_transactions_early(void)
489{ 489{
490 /* 490 /*
491 * Allow transactions to happen again (this function is called from 491 * Allow transactions to happen again (this function is called from
492 * atomic context during wakeup, so we don't need to acquire the mutex). 492 * atomic context during wakeup, so we don't need to acquire the mutex).
493 */ 493 */
494 if (first_ec) 494 if (first_ec)
495 clear_bit(EC_FLAGS_FROZEN, &first_ec->flags); 495 clear_bit(EC_FLAGS_BLOCKED, &first_ec->flags);
496} 496}
497 497
498static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 * data) 498static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 * data)