[CPUFREQ] Trivial cleanup for acpi read/write port in acpi-cpufreq.c
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Wed, 13 Dec 2006 18:41:16 +0000 (10:41 -0800)
committerDave Jones <davej@redhat.com>
Wed, 13 Dec 2006 23:12:31 +0000 (18:12 -0500)
Small cleanup in acpi-cpufreq.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c

index 18f4715c655d18a2a453558ac546c9154f93902e..8e0b995f79ec0e2fca841014bf3dc851aecf2d44 100644 (file)
@@ -126,27 +126,6 @@ static unsigned extract_freq(u32 val, struct acpi_cpufreq_data *data)
        }
 }
 
-static void wrport(u16 port, u8 bit_width, u32 value)
-{
-       if (bit_width <= 8)
-               outb(value, port);
-       else if (bit_width <= 16)
-               outw(value, port);
-       else if (bit_width <= 32)
-               outl(value, port);
-}
-
-static void rdport(u16 port, u8 bit_width, u32 * ret)
-{
-       *ret = 0;
-       if (bit_width <= 8)
-               *ret = inb(port);
-       else if (bit_width <= 16)
-               *ret = inw(port);
-       else if (bit_width <= 32)
-               *ret = inl(port);
-}
-
 struct msr_addr {
        u32 reg;
 };
@@ -177,7 +156,9 @@ static void do_drv_read(struct drv_cmd *cmd)
                rdmsr(cmd->addr.msr.reg, cmd->val, h);
                break;
        case SYSTEM_IO_CAPABLE:
-               rdport(cmd->addr.io.port, cmd->addr.io.bit_width, &cmd->val);
+               acpi_os_read_port((acpi_io_address)cmd->addr.io.port,
+                               &cmd->val,
+                               (u32)cmd->addr.io.bit_width);
                break;
        default:
                break;
@@ -193,7 +174,9 @@ static void do_drv_write(struct drv_cmd *cmd)
                wrmsr(cmd->addr.msr.reg, cmd->val, h);
                break;
        case SYSTEM_IO_CAPABLE:
-               wrport(cmd->addr.io.port, cmd->addr.io.bit_width, cmd->val);
+               acpi_os_write_port((acpi_io_address)cmd->addr.io.port,
+                               cmd->val,
+                               (u32)cmd->addr.io.bit_width);
                break;
        default:
                break;