Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=50c1e1138cb94f6aca0f8555777edbcefe0324e2
Commit:     50c1e1138cb94f6aca0f8555777edbcefe0324e2
Parent:     a86e277259b08be0f00cfcb182922da3ffc50f04
Author:     Alexey Starikovskiy <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 7 18:42:17 2006 +0300
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Fri Dec 8 02:56:07 2006 -0500

    ACPI: ec: Drop udelay() from poll mode. Loop by reading status field 
instead.
    
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/ec.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 722acaf..8ef74e7 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -70,8 +70,6 @@ enum {
 
 #define ACPI_EC_DELAY          500     /* Wait 500ms max. during EC ops */
 #define ACPI_EC_UDELAY_GLK     1000    /* Wait 1ms max. to get global lock */
-#define ACPI_EC_UDELAY         100     /* Poll @ 100us increments */
-#define ACPI_EC_UDELAY_COUNT   1000    /* Wait 100ms max. during EC ops */
 
 enum {
        EC_INTR = 1,    /* Output buffer full */
@@ -159,11 +157,10 @@ static int acpi_ec_check_status(struct acpi_ec *ec, u8 
event)
 static int acpi_ec_wait(struct acpi_ec *ec, u8 event)
 {
        if (acpi_ec_mode == EC_POLL) {
-               int i;
-               for (i = 0; i < ACPI_EC_UDELAY_COUNT; ++i) {
+               unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
+               while (time_before(jiffies, delay)) {
                        if (acpi_ec_check_status(ec, event))
                                return 0;
-                       udelay(ACPI_EC_UDELAY);
                }
        } else {
                if (wait_event_timeout(ec->wait,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to