X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Facpi%2Fosl.c;h=e3a673a008453dfda694aab503dad0c89b19cb1e;hb=09f3eca2b7e2762e223fdd359f9d0f6303a85f6c;hp=aabc6ca4a81c72463529c3e711b012f8b6e909a7;hpb=cfa76f024f7c9e65169425804e5b32e71f66d0ee;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index aabc6ca4a81..e3a673a0084 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -387,17 +387,14 @@ acpi_status acpi_os_read_port(acpi_io_address port, u32 * value, u32 width) 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(); }