Subject: ACPI : Modify the ACPI I/O Access width
>From : Zhao Yakui <[EMAIL PROTECTED]>
When the argument width is not the multiple of eight, the acpi I/O access
will fail. Modify the acpi I/O access width to the multiple of eight.
Signed-off-by: Zhao Yakui <[EMAIL PROTECTED]>
Signed-off-by: Li Shaohua <[EMAIL PROTECTED]>
---
drivers/acpi/osl.c | 25 +++++++++----------------
1 file changed, 9 insertions(+), 16 deletions(-)
Index: linux-2.6.24-rc1/drivers/acpi/osl.c
===================================================================
--- linux-2.6.24-rc1.orig/drivers/acpi/osl.c
+++ linux-2.6.24-rc1/drivers/acpi/osl.c
@@ -387,17 +387,14 @@ acpi_status acpi_os_read_port(acpi_io_ad
if (!value)
value = &dummy;
- switch (width) {
- case 8:
+ *value = 0;
+ if (width <= 8) {
*(u8 *) value = inb(port);
- break;
- case 16:
+ } else if (width <= 16) {
*(u16 *) value = inw(port);
- break;
- case 32:
+ } else if (width <= 32) {
*(u32 *) value = inl(port);
- break;
- default:
+ } else {
BUG();
}
@@ -408,17 +405,13 @@ EXPORT_SYMBOL(acpi_os_read_port);
acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width)
{
- switch (width) {
- case 8:
+ if (width <= 8) {
outb(value, port);
- break;
- case 16:
+ } else if (width <= 16) {
outw(value, port);
- break;
- case 32:
+ } else if (width <= 32) {
outl(value, port);
- break;
- default:
+ } else {
BUG();
}
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html