Fix misspellings collected by members of KJ list.
[powerpc.git] / drivers / firmware / pcdp.c
index ae1fb45..2b4b76e 100644 (file)
@@ -11,7 +11,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/acpi.h>
 #include <linux/console.h>
 #include <linux/efi.h>
@@ -27,7 +26,7 @@ setup_serial_console(struct pcdp_uart *uart)
        static char options[64], *p = options;
        char parity;
 
-       mmio = (uart->addr.address_space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY);
+       mmio = (uart->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY);
        p += sprintf(p, "console=uart,%s,0x%lx",
                mmio ? "mmio" : "io", uart->addr.address);
        if (uart->baud) {
@@ -89,19 +88,20 @@ efi_setup_pcdp_console(char *cmdline)
        struct pcdp_uart *uart;
        struct pcdp_device *dev, *end;
        int i, serial = 0;
+       int rc = -ENODEV;
 
-       pcdp = efi.hcdp;
-       if (!pcdp)
+       if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
                return -ENODEV;
 
-       printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, __pa(pcdp));
+       pcdp = ioremap(efi.hcdp, 4096);
+       printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, efi.hcdp);
 
        if (strstr(cmdline, "console=hcdp")) {
                if (pcdp->rev < 3)
                        serial = 1;
        } else if (strstr(cmdline, "console=")) {
                printk(KERN_INFO "Explicit \"console=\"; ignoring PCDP\n");
-               return -ENODEV;
+               goto out;
        }
 
        if (pcdp->rev < 3 && efi_uart_console_only())
@@ -110,7 +110,8 @@ efi_setup_pcdp_console(char *cmdline)
        for (i = 0, uart = pcdp->uart; i < pcdp->num_uarts; i++, uart++) {
                if (uart->flags & PCDP_UART_PRIMARY_CONSOLE || serial) {
                        if (uart->type == PCDP_CONSOLE_UART) {
-                               return setup_serial_console(uart);
+                               rc = setup_serial_console(uart);
+                               goto out;
                        }
                }
        }
@@ -121,10 +122,13 @@ efi_setup_pcdp_console(char *cmdline)
             dev = (struct pcdp_device *) ((u8 *) dev + dev->length)) {
                if (dev->flags & PCDP_PRIMARY_CONSOLE) {
                        if (dev->type == PCDP_CONSOLE_VGA) {
-                               return setup_vga_console(dev);
+                               rc = setup_vga_console(dev);
+                               goto out;
                        }
                }
        }
 
-       return -ENODEV;
+out:
+       iounmap(pcdp);
+       return rc;
 }