Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

8250: three way resolve of the 8250 diffs

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>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
ce7240e4 9833facf

+66 -59
+8 -8
drivers/char/mwave/mwavedd.c
··· 430 430 431 431 static int register_serial_portandirq(unsigned int port, int irq) 432 432 { 433 - struct uart_port uart; 433 + struct uart_8250_port uart; 434 434 435 435 switch ( port ) { 436 436 case 0x3f8: ··· 462 462 } /* switch */ 463 463 /* irq is okay */ 464 464 465 - memset(&uart, 0, sizeof(struct uart_port)); 465 + memset(&uart, 0, sizeof(uart)); 466 466 467 - uart.uartclk = 1843200; 468 - uart.iobase = port; 469 - uart.irq = irq; 470 - uart.iotype = UPIO_PORT; 471 - uart.flags = UPF_SHARE_IRQ; 472 - return serial8250_register_port(&uart); 467 + uart.port.uartclk = 1843200; 468 + uart.port.iobase = port; 469 + uart.port.irq = irq; 470 + uart.port.iotype = UPIO_PORT; 471 + uart.port.flags = UPF_SHARE_IRQ; 472 + return serial8250_register_8250_port(&uart); 473 473 } 474 474 475 475
+8 -8
drivers/misc/ibmasm/uart.c
··· 33 33 34 34 void ibmasm_register_uart(struct service_processor *sp) 35 35 { 36 - struct uart_port uport; 36 + struct uart_8250_port uart; 37 37 void __iomem *iomem_base; 38 38 39 39 iomem_base = sp->base_address + SCOUT_COM_B_BASE; ··· 47 47 return; 48 48 } 49 49 50 - memset(&uport, 0, sizeof(struct uart_port)); 51 - uport.irq = sp->irq; 52 - uport.uartclk = 3686400; 53 - uport.flags = UPF_SHARE_IRQ; 54 - uport.iotype = UPIO_MEM; 55 - uport.membase = iomem_base; 50 + memset(&uart, 0, sizeof(uart)); 51 + uart.port.irq = sp->irq; 52 + uart.port.uartclk = 3686400; 53 + uart.port.flags = UPF_SHARE_IRQ; 54 + uart.port.iotype = UPIO_MEM; 55 + uart.port.membase = iomem_base; 56 56 57 - sp->serial_line = serial8250_register_port(&uport); 57 + sp->serial_line = serial8250_register_8250_port(&uart); 58 58 if (sp->serial_line < 0) { 59 59 dev_err(sp->dev, "Failed to register serial port\n"); 60 60 return;
+11 -9
drivers/net/ethernet/sgi/ioc3-eth.c
··· 1147 1147 { 1148 1148 #define COSMISC_CONSTANT 6 1149 1149 1150 - struct uart_port port = { 1151 - .irq = 0, 1152 - .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, 1153 - .iotype = UPIO_MEM, 1154 - .regshift = 0, 1155 - .uartclk = (22000000 << 1) / COSMISC_CONSTANT, 1150 + struct uart_8250_port port = { 1151 + .port = { 1152 + .irq = 0, 1153 + .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, 1154 + .iotype = UPIO_MEM, 1155 + .regshift = 0, 1156 + .uartclk = (22000000 << 1) / COSMISC_CONSTANT, 1156 1157 1157 - .membase = (unsigned char __iomem *) uart, 1158 - .mapbase = (unsigned long) uart, 1158 + .membase = (unsigned char __iomem *) uart, 1159 + .mapbase = (unsigned long) uart, 1160 + } 1159 1161 }; 1160 1162 unsigned char lcr; 1161 1163 ··· 1166 1164 uart->iu_scr = COSMISC_CONSTANT, 1167 1165 uart->iu_lcr = lcr; 1168 1166 uart->iu_lcr; 1169 - serial8250_register_port(&port); 1167 + serial8250_register_8250_port(&port); 1170 1168 } 1171 1169 1172 1170 static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
-30
drivers/tty/serial/8250/8250.h
··· 13 13 14 14 #include <linux/serial_8250.h> 15 15 16 - struct uart_8250_port { 17 - struct uart_port port; 18 - struct timer_list timer; /* "no irq" timer */ 19 - struct list_head list; /* ports on this IRQ */ 20 - unsigned short capabilities; /* port capabilities */ 21 - unsigned short bugs; /* port bugs */ 22 - unsigned int tx_loadsz; /* transmit fifo load size */ 23 - unsigned char acr; 24 - unsigned char ier; 25 - unsigned char lcr; 26 - unsigned char mcr; 27 - unsigned char mcr_mask; /* mask of user bits */ 28 - unsigned char mcr_force; /* mask of forced bits */ 29 - unsigned char cur_iotype; /* Running I/O type */ 30 - 31 - /* 32 - * Some bits in registers are cleared on a read, so they must 33 - * be saved whenever the register is read but the bits will not 34 - * be immediately processed. 35 - */ 36 - #define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS 37 - unsigned char lsr_saved_flags; 38 - #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA 39 - unsigned char msr_saved_flags; 40 - 41 - /* 8250 specific callbacks */ 42 - int (*dl_read)(struct uart_8250_port *); 43 - void (*dl_write)(struct uart_8250_port *, int); 44 - }; 45 - 46 16 struct old_serial_port { 47 17 unsigned int uart; 48 18 unsigned int baud_base;
+1 -1
drivers/tty/serial/8250/8250_dw.c
··· 141 141 dev_err(&pdev->dev, "no clock-frequency property set\n"); 142 142 return -EINVAL; 143 143 } 144 - uart.uart.port.uartclk = val; 144 + uart.port.uartclk = val; 145 145 146 146 data->line = serial8250_register_8250_port(&uart); 147 147 if (data->line < 0)
+8 -1
drivers/tty/serial/of_serial.c
··· 144 144 switch (port_type) { 145 145 #ifdef CONFIG_SERIAL_8250 146 146 case PORT_8250 ... PORT_MAX_8250: 147 - ret = serial8250_register_port(&port); 147 + { 148 + /* For now the of bindings don't support the extra 149 + 8250 specific bits */ 150 + struct uart_8250_port port8250; 151 + memset(&port8250, 0, sizeof(port8250)); 152 + port8250.port = port; 153 + ret = serial8250_register_8250_port(&port8250); 148 154 break; 155 + } 149 156 #endif 150 157 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL 151 158 case PORT_NWPSERIAL:
+30 -2
include/linux/serial_8250.h
··· 65 65 * platform device. Using these will make your driver 66 66 * dependent on the 8250 driver. 67 67 */ 68 - struct uart_port; 69 - struct uart_8250_port; 68 + 69 + struct uart_8250_port { 70 + struct uart_port port; 71 + struct timer_list timer; /* "no irq" timer */ 72 + struct list_head list; /* ports on this IRQ */ 73 + unsigned short capabilities; /* port capabilities */ 74 + unsigned short bugs; /* port bugs */ 75 + unsigned int tx_loadsz; /* transmit fifo load size */ 76 + unsigned char acr; 77 + unsigned char ier; 78 + unsigned char lcr; 79 + unsigned char mcr; 80 + unsigned char mcr_mask; /* mask of user bits */ 81 + unsigned char mcr_force; /* mask of forced bits */ 82 + unsigned char cur_iotype; /* Running I/O type */ 83 + 84 + /* 85 + * Some bits in registers are cleared on a read, so they must 86 + * be saved whenever the register is read but the bits will not 87 + * be immediately processed. 88 + */ 89 + #define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS 90 + unsigned char lsr_saved_flags; 91 + #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA 92 + unsigned char msr_saved_flags; 93 + 94 + /* 8250 specific callbacks */ 95 + int (*dl_read)(struct uart_8250_port *); 96 + void (*dl_write)(struct uart_8250_port *, int); 97 + }; 70 98 71 99 int serial8250_register_8250_port(struct uart_8250_port *); 72 100 void serial8250_unregister_port(int line);