From aaa6633745c04191f656d2778bbf93ce60dfbca0 Mon Sep 17 00:00:00 2001 From: Luming Yu Date: Sat, 19 Mar 2005 01:54:47 -0500 Subject: [PATCH] --- yaml --- r: 4721 b: refs/heads/master c: fa9cd547e097df4966b8bd5c94aeed953e32b14d h: refs/heads/master i: 4719: 5bdb45a194573a030658298163f01d9bb65a10d1 v: v3 --- [refs] | 2 +- trunk/drivers/acpi/ec.c | 32 ++++++++++++++------------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index 6ab66bd602e3..6833c090bd5a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 451566f45a2e6cd10ba56e7220a9dd84ba3ef550 +refs/heads/master: fa9cd547e097df4966b8bd5c94aeed953e32b14d diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 69b04d430f00..e37162229342 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -600,7 +600,7 @@ acpi_ec_space_handler ( { int result = 0; struct acpi_ec *ec = NULL; - u32 temp = 0; + u64 temp = *value; acpi_integer f_v = 0; int i = 0; @@ -609,10 +609,9 @@ acpi_ec_space_handler ( if ((address > 0xFF) || !value || !handler_context) return_VALUE(AE_BAD_PARAMETER); - if(bit_width != 8) { + if (bit_width != 8 && acpi_strict) { printk(KERN_WARNING PREFIX "acpi_ec_space_handler: bit_width should be 8\n"); - if (acpi_strict) - return_VALUE(AE_BAD_PARAMETER); + return_VALUE(AE_BAD_PARAMETER); } ec = (struct acpi_ec *) handler_context; @@ -620,11 +619,11 @@ acpi_ec_space_handler ( next_byte: switch (function) { case ACPI_READ: - result = acpi_ec_read(ec, (u8) address, &temp); - *value = (acpi_integer) temp; + temp = 0; + result = acpi_ec_read(ec, (u8) address, (u32 *)&temp); break; case ACPI_WRITE: - result = acpi_ec_write(ec, (u8) address, (u8) *value); + result = acpi_ec_write(ec, (u8) address, (u8) temp); break; default: result = -EINVAL; @@ -633,19 +632,18 @@ acpi_ec_space_handler ( } bit_width -= 8; - if(bit_width){ - - if(function == ACPI_READ) - f_v |= (acpi_integer) (*value) << 8*i; - if(function == ACPI_WRITE) - (*value) >>=8; + if (bit_width) { + if (function == ACPI_READ) + f_v |= temp << 8 * i; + if (function == ACPI_WRITE) + temp >>= 8; i++; + (u8)address ++; goto next_byte; } - - if(function == ACPI_READ){ - f_v |= (acpi_integer) (*value) << 8*i; + if (function == ACPI_READ) { + f_v |= temp << 8 * i; *value = f_v; } @@ -664,8 +662,6 @@ acpi_ec_space_handler ( default: return_VALUE(AE_OK); } - - }