提交 49fbabf5 编写于 作者: Z Zhao Yakui 提交者: Len Brown

ACPI: Handle I/O access width requestst that are not a multiple of 8 bits.

We've run into BIOS that hand us 4-bit access width requests
for T-state control when the code expected only multipls of 8-bits.
Round up.
Signed-off-by: NZhao Yakui <yakui.zhao@intel.com>
Signed-off-by: NLi Shaohua <shaohua.li@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 ef54d5ad
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册