8250: three way resolve of the 8250 diffs
authorAlan Cox <alan@linux.intel.com>
Tue, 17 Jul 2012 16:06:20 +0000 (17:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jul 2012 16:11:50 +0000 (09:11 -0700)
This resolves the differences between the original 8250 patch, the revised 8250 patch
and the independant clean up of the octeon driver (to use platform devices properly yay!)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/mwave/mwavedd.c
drivers/misc/ibmasm/uart.c
drivers/net/ethernet/sgi/ioc3-eth.c
drivers/tty/serial/8250/8250.h
drivers/tty/serial/8250/8250_dw.c
drivers/tty/serial/of_serial.c
include/linux/serial_8250.h

index 1d82d5838f0c38c416947d7f95b17d204d0a93b1..164544afd6809b1c1287c5d3fb02c99a29de7ab6 100644 (file)
@@ -430,7 +430,7 @@ static ssize_t mwave_write(struct file *file, const char __user *buf,
 
 static int register_serial_portandirq(unsigned int port, int irq)
 {
-       struct uart_port uart;
+       struct uart_8250_port uart;
        
        switch ( port ) {
                case 0x3f8:
@@ -462,14 +462,14 @@ static int register_serial_portandirq(unsigned int port, int irq)
        } /* switch */
        /* irq is okay */
 
-       memset(&uart, 0, sizeof(struct uart_port));
+       memset(&uart, 0, sizeof(uart));
        
-       uart.uartclk =  1843200;
-       uart.iobase = port;
-       uart.irq = irq;
-       uart.iotype = UPIO_PORT;
-       uart.flags =  UPF_SHARE_IRQ;
-       return serial8250_register_port(&uart);
+       uart.port.uartclk =  1843200;
+       uart.port.iobase = port;
+       uart.port.irq = irq;
+       uart.port.iotype = UPIO_PORT;
+       uart.port.flags =  UPF_SHARE_IRQ;
+       return serial8250_register_8250_port(&uart);
 }
 
 
index 1dcb9ae1905a0853d45795082561f61a0fb56a15..01e2b0d7e59043cfcf652090b5c328a789dd9383 100644 (file)
@@ -33,7 +33,7 @@
 
 void ibmasm_register_uart(struct service_processor *sp)
 {
-       struct uart_port uport;
+       struct uart_8250_port uart;
        void __iomem *iomem_base;
 
        iomem_base = sp->base_address + SCOUT_COM_B_BASE;
@@ -47,14 +47,14 @@ void ibmasm_register_uart(struct service_processor *sp)
                return;
        }
 
-       memset(&uport, 0, sizeof(struct uart_port));
-       uport.irq       = sp->irq;
-       uport.uartclk   = 3686400;
-       uport.flags     = UPF_SHARE_IRQ;
-       uport.iotype    = UPIO_MEM;
-       uport.membase   = iomem_base;
+       memset(&uart, 0, sizeof(uart));
+       uart.port.irq           = sp->irq;
+       uart.port.uartclk       = 3686400;
+       uart.port.flags         = UPF_SHARE_IRQ;
+       uart.port.iotype        = UPIO_MEM;
+       uart.port.membase       = iomem_base;
 
-       sp->serial_line = serial8250_register_port(&uport);
+       sp->serial_line = serial8250_register_8250_port(&uart);
        if (sp->serial_line < 0) {
                dev_err(sp->dev, "Failed to register serial port\n");
                return;
index ac149d99f78ff0a5ba79de441cda7dd2e1e86484..fcb5b0e0f260d6a0f1c6b18f8e20ab3ff6aa564f 100644 (file)
@@ -1147,15 +1147,17 @@ static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
 {
 #define COSMISC_CONSTANT 6
 
-       struct uart_port port = {
-               .irq            = 0,
-               .flags          = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
-               .iotype         = UPIO_MEM,
-               .regshift       = 0,
-               .uartclk        = (22000000 << 1) / COSMISC_CONSTANT,
-
-               .membase        = (unsigned char __iomem *) uart,
-               .mapbase        = (unsigned long) uart,
+       struct uart_8250_port port = {
+               .port = {
+                       .irq            = 0,
+                       .flags          = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
+                       .iotype         = UPIO_MEM,
+                       .regshift       = 0,
+                       .uartclk        = (22000000 << 1) / COSMISC_CONSTANT,
+
+                       .membase        = (unsigned char __iomem *) uart,
+                       .mapbase        = (unsigned long) uart,
+                }
        };
        unsigned char lcr;
 
@@ -1164,7 +1166,7 @@ static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
        uart->iu_scr = COSMISC_CONSTANT,
        uart->iu_lcr = lcr;
        uart->iu_lcr;
-       serial8250_register_port(&port);
+       serial8250_register_8250_port(&port);
 }
 
 static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
index c335b2b23a5f9757d8d6caa1ab12442e4509a18c..972b5212b58cbc3f28fef7a112fbbda17301606c 100644 (file)
 
 #include <linux/serial_8250.h>
 
-struct uart_8250_port {
-       struct uart_port        port;
-       struct timer_list       timer;          /* "no irq" timer */
-       struct list_head        list;           /* ports on this IRQ */
-       unsigned short          capabilities;   /* port capabilities */
-       unsigned short          bugs;           /* port bugs */
-       unsigned int            tx_loadsz;      /* transmit fifo load size */
-       unsigned char           acr;
-       unsigned char           ier;
-       unsigned char           lcr;
-       unsigned char           mcr;
-       unsigned char           mcr_mask;       /* mask of user bits */
-       unsigned char           mcr_force;      /* mask of forced bits */
-       unsigned char           cur_iotype;     /* Running I/O type */
-
-       /*
-        * Some bits in registers are cleared on a read, so they must
-        * be saved whenever the register is read but the bits will not
-        * be immediately processed.
-        */
-#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
-       unsigned char           lsr_saved_flags;
-#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
-       unsigned char           msr_saved_flags;
-
-       /* 8250 specific callbacks */
-       int                     (*dl_read)(struct uart_8250_port *);
-       void                    (*dl_write)(struct uart_8250_port *, int);
-};
-
 struct old_serial_port {
        unsigned int uart;
        unsigned int baud_base;
index afb955fdef03ec558152853191591e30ba94086b..c3b2ec0c8c0b7f3a6749f41feedb38fe0af58ac2 100644 (file)
@@ -141,7 +141,7 @@ static int __devinit dw8250_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "no clock-frequency property set\n");
                return -EINVAL;
        }
-       uart.uart.port.uartclk = val;
+       uart.port.uartclk = val;
 
        data->line = serial8250_register_8250_port(&uart);
        if (data->line < 0)
index 34e71874a89266db9ebd47cb9a156e89192af7a1..ffc7879e85a4dc9aa09123c82473c06d1300b914 100644 (file)
@@ -144,8 +144,15 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
        switch (port_type) {
 #ifdef CONFIG_SERIAL_8250
        case PORT_8250 ... PORT_MAX_8250:
-               ret = serial8250_register_port(&port);
+       {
+               /* For now the of bindings don't support the extra
+                  8250 specific bits */
+               struct uart_8250_port port8250;
+               memset(&port8250, 0, sizeof(port8250));
+               port8250.port = port;
+               ret = serial8250_register_8250_port(&port8250);
                break;
+       }
 #endif
 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
        case PORT_NWPSERIAL:
index f41dcc9492181eb5602c6989a89c8e6f8346c172..c174c90fb3fbcbb56abb5096f40ee559a75aeb94 100644 (file)
@@ -65,8 +65,36 @@ enum {
  * platform device.  Using these will make your driver
  * dependent on the 8250 driver.
  */
-struct uart_port;
-struct uart_8250_port;
+
+struct uart_8250_port {
+       struct uart_port        port;
+       struct timer_list       timer;          /* "no irq" timer */
+       struct list_head        list;           /* ports on this IRQ */
+       unsigned short          capabilities;   /* port capabilities */
+       unsigned short          bugs;           /* port bugs */
+       unsigned int            tx_loadsz;      /* transmit fifo load size */
+       unsigned char           acr;
+       unsigned char           ier;
+       unsigned char           lcr;
+       unsigned char           mcr;
+       unsigned char           mcr_mask;       /* mask of user bits */
+       unsigned char           mcr_force;      /* mask of forced bits */
+       unsigned char           cur_iotype;     /* Running I/O type */
+
+       /*
+        * Some bits in registers are cleared on a read, so they must
+        * be saved whenever the register is read but the bits will not
+        * be immediately processed.
+        */
+#define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS
+       unsigned char           lsr_saved_flags;
+#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
+       unsigned char           msr_saved_flags;
+
+       /* 8250 specific callbacks */
+       int                     (*dl_read)(struct uart_8250_port *);
+       void                    (*dl_write)(struct uart_8250_port *, int);
+};
 
 int serial8250_register_8250_port(struct uart_8250_port *);
 void serial8250_unregister_port(int line);