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

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] serial: update NEC VR4100 series serial support

- Changed the return value of unknown type to NULL.

- Deleted the NULL check of dev_id in siu_interrupt().

- Deleted the NULL check of port->membase in siu_shutdown().

- Added the NULL check of port->membase to siu_startup().

- Removed early_uart_ops. Now using vr41xx_siu standerd one.

- Changed KSEG1ADDR() in siu_console_setup() to ioremap().

- When uart_add_one_port() failed, changed to set NULL to port->dev.

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Yoichi Yuasa and committed by
Linus Torvalds
eae936e2 f26d583e

+9 -57
+9 -57
drivers/serial/vr41xx_siu.c
··· 234 234 return "DSIU"; 235 235 } 236 236 237 - return "unknown"; 237 + return NULL; 238 238 } 239 239 240 240 static unsigned int siu_tx_empty(struct uart_port *port) ··· 482 482 struct uart_port *port; 483 483 uint8_t iir, lsr; 484 484 485 - if (dev_id == NULL) 486 - return IRQ_NONE; 487 - 488 485 port = (struct uart_port *)dev_id; 489 486 490 487 iir = siu_read(port, UART_IIR); ··· 503 506 static int siu_startup(struct uart_port *port) 504 507 { 505 508 int retval; 509 + 510 + if (port->membase == NULL) 511 + return -ENODEV; 506 512 507 513 siu_clear_fifo(port); 508 514 ··· 544 544 { 545 545 unsigned long flags; 546 546 uint8_t lcr; 547 - 548 - if (port->membase == NULL) 549 - return; 550 547 551 548 siu_write(port, UART_IER, 0); 552 549 ··· 799 802 800 803 #ifdef CONFIG_SERIAL_VR41XX_CONSOLE 801 804 802 - static void early_set_termios(struct uart_port *port, struct termios *new, 803 - struct termios *old) 804 - { 805 - tcflag_t c_cflag; 806 - uint8_t lcr; 807 - unsigned int baud, quot; 808 - 809 - c_cflag = new->c_cflag; 810 - switch (c_cflag & CSIZE) { 811 - case CS5: 812 - lcr = UART_LCR_WLEN5; 813 - break; 814 - case CS6: 815 - lcr = UART_LCR_WLEN6; 816 - break; 817 - case CS7: 818 - lcr = UART_LCR_WLEN7; 819 - break; 820 - default: 821 - lcr = UART_LCR_WLEN8; 822 - break; 823 - } 824 - 825 - if (c_cflag & CSTOPB) 826 - lcr |= UART_LCR_STOP; 827 - if (c_cflag & PARENB) 828 - lcr |= UART_LCR_PARITY; 829 - if ((c_cflag & PARODD) != PARODD) 830 - lcr |= UART_LCR_EPAR; 831 - if (c_cflag & CMSPAR) 832 - lcr |= UART_LCR_SPAR; 833 - 834 - baud = uart_get_baud_rate(port, new, old, 0, port->uartclk/16); 835 - quot = uart_get_divisor(port, baud); 836 - 837 - siu_write(port, UART_LCR, lcr | UART_LCR_DLAB); 838 - 839 - siu_write(port, UART_DLL, (uint8_t)quot); 840 - siu_write(port, UART_DLM, (uint8_t)(quot >> 8)); 841 - 842 - siu_write(port, UART_LCR, lcr); 843 - } 844 - 845 - static struct uart_ops early_uart_ops = { 846 - .set_termios = early_set_termios, 847 - }; 848 - 849 805 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 850 806 851 807 static void wait_for_xmitr(struct uart_port *port) ··· 865 915 if (port->membase == NULL) { 866 916 if (port->mapbase == 0) 867 917 return -ENODEV; 868 - port->membase = (unsigned char __iomem *)KSEG1ADDR(port->mapbase); 918 + port->membase = ioremap(port->mapbase, siu_port_size(port)); 869 919 } 870 920 871 921 vr41xx_select_siu_interface(SIU_INTERFACE_RS232C); ··· 899 949 900 950 for (i = 0; i < num; i++) { 901 951 port = &siu_uart_ports[i]; 902 - port->ops = &early_uart_ops; 952 + port->ops = &siu_uart_ops; 903 953 } 904 954 905 955 register_console(&siu_console); ··· 944 994 port->dev = dev; 945 995 946 996 retval = uart_add_one_port(&siu_uart_driver, port); 947 - if (retval) 997 + if (retval < 0) { 998 + port->dev = NULL; 948 999 break; 1000 + } 949 1001 } 950 1002 951 1003 if (i == 0 && retval < 0) {