aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2012-03-08 19:12:13 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-09 15:47:56 -0500
commit4fd996a14660f56a6fd92ce7c8fb167d262c994f (patch)
treec149a1381a41f5581861d9c463182a371a2ad12e /drivers/tty
parent927353a75602dd97144352f53177e18093fdd198 (diff)
serial: use serial_port_in/out vs serial_in/out in 8250
The serial_in and serial_out helpers are expecting to operate on an 8250_port struct. These in turn go after the contained normal port struct which actually has the actual in/out accessors. But what is happening in some cases, is that a function is passed in a port struct, and it runs container_of to get the 8250_port struct, and then it uses serial_in/out helpers on that. But when you do, it goes full circle, since it jumps back inside the 8250_port to find the contained port struct (which we already knew!). So, if we are operating in a scope where we know the struct port, then use the serial_port_in/out helpers and avoid the bouncing around. If we don't have the struct port handy, and it isn't worth making a local for it, then just leave things as-is which uses the serial_in/out helpers that will resolve the 8250_port onto the struct port. Mostly, gcc figures this out on its own -- so this doesn't bring to the table any revolutionary runtime delta. However, it is somewhat misleading to always hammer away on 8250 structs, when the actual underlying property isn't at all 8250 specific -- and this change makes that clear. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250.c160
1 files changed, 80 insertions, 80 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index a0d114d8baef..7898295e4148 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -1287,7 +1287,7 @@ static void serial8250_start_tx(struct uart_port *port)
1287 1287
1288 if (!(up->ier & UART_IER_THRI)) { 1288 if (!(up->ier & UART_IER_THRI)) {
1289 up->ier |= UART_IER_THRI; 1289 up->ier |= UART_IER_THRI;
1290 serial_out(up, UART_IER, up->ier); 1290 serial_port_out(port, UART_IER, up->ier);
1291 1291
1292 if (up->bugs & UART_BUG_TXEN) { 1292 if (up->bugs & UART_BUG_TXEN) {
1293 unsigned char lsr; 1293 unsigned char lsr;
@@ -1316,7 +1316,7 @@ static void serial8250_stop_rx(struct uart_port *port)
1316 1316
1317 up->ier &= ~UART_IER_RLSI; 1317 up->ier &= ~UART_IER_RLSI;
1318 up->port.read_status_mask &= ~UART_LSR_DR; 1318 up->port.read_status_mask &= ~UART_LSR_DR;
1319 serial_out(up, UART_IER, up->ier); 1319 serial_port_out(port, UART_IER, up->ier);
1320} 1320}
1321 1321
1322static void serial8250_enable_ms(struct uart_port *port) 1322static void serial8250_enable_ms(struct uart_port *port)
@@ -1329,7 +1329,7 @@ static void serial8250_enable_ms(struct uart_port *port)
1329 return; 1329 return;
1330 1330
1331 up->ier |= UART_IER_MSI; 1331 up->ier |= UART_IER_MSI;
1332 serial_out(up, UART_IER, up->ier); 1332 serial_port_out(port, UART_IER, up->ier);
1333} 1333}
1334 1334
1335/* 1335/*
@@ -1523,7 +1523,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
1523 1523
1524 spin_lock_irqsave(&port->lock, flags); 1524 spin_lock_irqsave(&port->lock, flags);
1525 1525
1526 status = serial_in(up, UART_LSR); 1526 status = serial_port_in(port, UART_LSR);
1527 1527
1528 DEBUG_INTR("status = %x...", status); 1528 DEBUG_INTR("status = %x...", status);
1529 1529
@@ -1540,9 +1540,7 @@ EXPORT_SYMBOL_GPL(serial8250_handle_irq);
1540 1540
1541static int serial8250_default_handle_irq(struct uart_port *port) 1541static int serial8250_default_handle_irq(struct uart_port *port)
1542{ 1542{
1543 struct uart_8250_port *up = 1543 unsigned int iir = serial_port_in(port, UART_IIR);
1544 container_of(port, struct uart_8250_port, port);
1545 unsigned int iir = serial_in(up, UART_IIR);
1546 1544
1547 return serial8250_handle_irq(port, iir); 1545 return serial8250_handle_irq(port, iir);
1548} 1546}
@@ -1776,7 +1774,7 @@ static unsigned int serial8250_tx_empty(struct uart_port *port)
1776 unsigned int lsr; 1774 unsigned int lsr;
1777 1775
1778 spin_lock_irqsave(&port->lock, flags); 1776 spin_lock_irqsave(&port->lock, flags);
1779 lsr = serial_in(up, UART_LSR); 1777 lsr = serial_port_in(port, UART_LSR);
1780 up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; 1778 up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
1781 spin_unlock_irqrestore(&port->lock, flags); 1779 spin_unlock_irqrestore(&port->lock, flags);
1782 1780
@@ -1823,7 +1821,7 @@ static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
1823 1821
1824 mcr = (mcr & up->mcr_mask) | up->mcr_force | up->mcr; 1822 mcr = (mcr & up->mcr_mask) | up->mcr_force | up->mcr;
1825 1823
1826 serial_out(up, UART_MCR, mcr); 1824 serial_port_out(port, UART_MCR, mcr);
1827} 1825}
1828 1826
1829static void serial8250_break_ctl(struct uart_port *port, int break_state) 1827static void serial8250_break_ctl(struct uart_port *port, int break_state)
@@ -1837,7 +1835,7 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state)
1837 up->lcr |= UART_LCR_SBC; 1835 up->lcr |= UART_LCR_SBC;
1838 else 1836 else
1839 up->lcr &= ~UART_LCR_SBC; 1837 up->lcr &= ~UART_LCR_SBC;
1840 serial_out(up, UART_LCR, up->lcr); 1838 serial_port_out(port, UART_LCR, up->lcr);
1841 spin_unlock_irqrestore(&port->lock, flags); 1839 spin_unlock_irqrestore(&port->lock, flags);
1842} 1840}
1843 1841
@@ -1883,14 +1881,12 @@ static void wait_for_xmitr(struct uart_8250_port *up, int bits)
1883 1881
1884static int serial8250_get_poll_char(struct uart_port *port) 1882static int serial8250_get_poll_char(struct uart_port *port)
1885{ 1883{
1886 struct uart_8250_port *up = 1884 unsigned char lsr = serial_port_in(port, UART_LSR);
1887 container_of(port, struct uart_8250_port, port);
1888 unsigned char lsr = serial_in(up, UART_LSR);
1889 1885
1890 if (!(lsr & UART_LSR_DR)) 1886 if (!(lsr & UART_LSR_DR))
1891 return NO_POLL_CHAR; 1887 return NO_POLL_CHAR;
1892 1888
1893 return serial_in(up, UART_RX); 1889 return serial_port_in(port, UART_RX);
1894} 1890}
1895 1891
1896 1892
@@ -1904,21 +1900,21 @@ static void serial8250_put_poll_char(struct uart_port *port,
1904 /* 1900 /*
1905 * First save the IER then disable the interrupts 1901 * First save the IER then disable the interrupts
1906 */ 1902 */
1907 ier = serial_in(up, UART_IER); 1903 ier = serial_port_in(port, UART_IER);
1908 if (up->capabilities & UART_CAP_UUE) 1904 if (up->capabilities & UART_CAP_UUE)
1909 serial_out(up, UART_IER, UART_IER_UUE); 1905 serial_port_out(port, UART_IER, UART_IER_UUE);
1910 else 1906 else
1911 serial_out(up, UART_IER, 0); 1907 serial_port_out(port, UART_IER, 0);
1912 1908
1913 wait_for_xmitr(up, BOTH_EMPTY); 1909 wait_for_xmitr(up, BOTH_EMPTY);
1914 /* 1910 /*
1915 * Send the character out. 1911 * Send the character out.
1916 * If a LF, also do CR... 1912 * If a LF, also do CR...
1917 */ 1913 */
1918 serial_out(up, UART_TX, c); 1914 serial_port_out(port, UART_TX, c);
1919 if (c == 10) { 1915 if (c == 10) {
1920 wait_for_xmitr(up, BOTH_EMPTY); 1916 wait_for_xmitr(up, BOTH_EMPTY);
1921 serial_out(up, UART_TX, 13); 1917 serial_port_out(port, UART_TX, 13);
1922 } 1918 }
1923 1919
1924 /* 1920 /*
@@ -1926,7 +1922,7 @@ static void serial8250_put_poll_char(struct uart_port *port,
1926 * and restore the IER 1922 * and restore the IER
1927 */ 1923 */
1928 wait_for_xmitr(up, BOTH_EMPTY); 1924 wait_for_xmitr(up, BOTH_EMPTY);
1929 serial_out(up, UART_IER, ier); 1925 serial_port_out(port, UART_IER, ier);
1930} 1926}
1931 1927
1932#endif /* CONFIG_CONSOLE_POLL */ 1928#endif /* CONFIG_CONSOLE_POLL */
@@ -1950,14 +1946,14 @@ static int serial8250_startup(struct uart_port *port)
1950 if (port->type == PORT_16C950) { 1946 if (port->type == PORT_16C950) {
1951 /* Wake up and initialize UART */ 1947 /* Wake up and initialize UART */
1952 up->acr = 0; 1948 up->acr = 0;
1953 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 1949 serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
1954 serial_out(up, UART_EFR, UART_EFR_ECB); 1950 serial_port_out(port, UART_EFR, UART_EFR_ECB);
1955 serial_out(up, UART_IER, 0); 1951 serial_port_out(port, UART_IER, 0);
1956 serial_out(up, UART_LCR, 0); 1952 serial_port_out(port, UART_LCR, 0);
1957 serial_icr_write(up, UART_CSR, 0); /* Reset the UART */ 1953 serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
1958 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 1954 serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
1959 serial_out(up, UART_EFR, UART_EFR_ECB); 1955 serial_port_out(port, UART_EFR, UART_EFR_ECB);
1960 serial_out(up, UART_LCR, 0); 1956 serial_port_out(port, UART_LCR, 0);
1961 } 1957 }
1962 1958
1963#ifdef CONFIG_SERIAL_8250_RSA 1959#ifdef CONFIG_SERIAL_8250_RSA
@@ -1977,10 +1973,10 @@ static int serial8250_startup(struct uart_port *port)
1977 /* 1973 /*
1978 * Clear the interrupt registers. 1974 * Clear the interrupt registers.
1979 */ 1975 */
1980 serial_in(up, UART_LSR); 1976 serial_port_in(port, UART_LSR);
1981 serial_in(up, UART_RX); 1977 serial_port_in(port, UART_RX);
1982 serial_in(up, UART_IIR); 1978 serial_port_in(port, UART_IIR);
1983 serial_in(up, UART_MSR); 1979 serial_port_in(port, UART_MSR);
1984 1980
1985 /* 1981 /*
1986 * At this point, there's no way the LSR could still be 0xff; 1982 * At this point, there's no way the LSR could still be 0xff;
@@ -1988,7 +1984,7 @@ static int serial8250_startup(struct uart_port *port)
1988 * here. 1984 * here.
1989 */ 1985 */
1990 if (!(port->flags & UPF_BUGGY_UART) && 1986 if (!(port->flags & UPF_BUGGY_UART) &&
1991 (serial_in(up, UART_LSR) == 0xff)) { 1987 (serial_port_in(port, UART_LSR) == 0xff)) {
1992 printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n", 1988 printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
1993 serial_index(port)); 1989 serial_index(port));
1994 return -ENODEV; 1990 return -ENODEV;
@@ -2003,12 +1999,14 @@ static int serial8250_startup(struct uart_port *port)
2003 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 1999 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
2004 2000
2005 fctr = serial_in(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX); 2001 fctr = serial_in(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX);
2006 serial_out(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX); 2002 serial_port_out(port, UART_FCTR,
2007 serial_out(up, UART_TRG, UART_TRG_96); 2003 fctr | UART_FCTR_TRGD | UART_FCTR_RX);
2008 serial_out(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_TX); 2004 serial_port_out(port, UART_TRG, UART_TRG_96);
2009 serial_out(up, UART_TRG, UART_TRG_96); 2005 serial_port_out(port, UART_FCTR,
2006 fctr | UART_FCTR_TRGD | UART_FCTR_TX);
2007 serial_port_out(port, UART_TRG, UART_TRG_96);
2010 2008
2011 serial_out(up, UART_LCR, 0); 2009 serial_port_out(port, UART_LCR, 0);
2012 } 2010 }
2013 2011
2014 if (port->irq) { 2012 if (port->irq) {
@@ -2028,12 +2026,12 @@ static int serial8250_startup(struct uart_port *port)
2028 wait_for_xmitr(up, UART_LSR_THRE); 2026 wait_for_xmitr(up, UART_LSR_THRE);
2029 serial_out_sync(up, UART_IER, UART_IER_THRI); 2027 serial_out_sync(up, UART_IER, UART_IER_THRI);
2030 udelay(1); /* allow THRE to set */ 2028 udelay(1); /* allow THRE to set */
2031 iir1 = serial_in(up, UART_IIR); 2029 iir1 = serial_port_in(port, UART_IIR);
2032 serial_out(up, UART_IER, 0); 2030 serial_port_out(port, UART_IER, 0);
2033 serial_out_sync(up, UART_IER, UART_IER_THRI); 2031 serial_out_sync(up, UART_IER, UART_IER_THRI);
2034 udelay(1); /* allow a working UART time to re-assert THRE */ 2032 udelay(1); /* allow a working UART time to re-assert THRE */
2035 iir = serial_in(up, UART_IIR); 2033 iir = serial_port_in(port, UART_IIR);
2036 serial_out(up, UART_IER, 0); 2034 serial_port_out(port, UART_IER, 0);
2037 2035
2038 if (port->irqflags & IRQF_SHARED) 2036 if (port->irqflags & IRQF_SHARED)
2039 enable_irq(port->irq); 2037 enable_irq(port->irq);
@@ -2078,7 +2076,7 @@ static int serial8250_startup(struct uart_port *port)
2078 /* 2076 /*
2079 * Now, initialize the UART 2077 * Now, initialize the UART
2080 */ 2078 */
2081 serial_out(up, UART_LCR, UART_LCR_WLEN8); 2079 serial_port_out(port, UART_LCR, UART_LCR_WLEN8);
2082 2080
2083 spin_lock_irqsave(&port->lock, flags); 2081 spin_lock_irqsave(&port->lock, flags);
2084 if (up->port.flags & UPF_FOURPORT) { 2082 if (up->port.flags & UPF_FOURPORT) {
@@ -2111,10 +2109,10 @@ static int serial8250_startup(struct uart_port *port)
2111 * Do a quick test to see if we receive an 2109 * Do a quick test to see if we receive an
2112 * interrupt when we enable the TX irq. 2110 * interrupt when we enable the TX irq.
2113 */ 2111 */
2114 serial_out(up, UART_IER, UART_IER_THRI); 2112 serial_port_out(port, UART_IER, UART_IER_THRI);
2115 lsr = serial_in(up, UART_LSR); 2113 lsr = serial_port_in(port, UART_LSR);
2116 iir = serial_in(up, UART_IIR); 2114 iir = serial_port_in(port, UART_IIR);
2117 serial_out(up, UART_IER, 0); 2115 serial_port_out(port, UART_IER, 0);
2118 2116
2119 if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) { 2117 if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
2120 if (!(up->bugs & UART_BUG_TXEN)) { 2118 if (!(up->bugs & UART_BUG_TXEN)) {
@@ -2134,10 +2132,10 @@ dont_test_tx_en:
2134 * saved flags to avoid getting false values from polling 2132 * saved flags to avoid getting false values from polling
2135 * routines or the previous session. 2133 * routines or the previous session.
2136 */ 2134 */
2137 serial_in(up, UART_LSR); 2135 serial_port_in(port, UART_LSR);
2138 serial_in(up, UART_RX); 2136 serial_port_in(port, UART_RX);
2139 serial_in(up, UART_IIR); 2137 serial_port_in(port, UART_IIR);
2140 serial_in(up, UART_MSR); 2138 serial_port_in(port, UART_MSR);
2141 up->lsr_saved_flags = 0; 2139 up->lsr_saved_flags = 0;
2142 up->msr_saved_flags = 0; 2140 up->msr_saved_flags = 0;
2143 2141
@@ -2147,7 +2145,7 @@ dont_test_tx_en:
2147 * anyway, so we don't enable them here. 2145 * anyway, so we don't enable them here.
2148 */ 2146 */
2149 up->ier = UART_IER_RLSI | UART_IER_RDI; 2147 up->ier = UART_IER_RLSI | UART_IER_RDI;
2150 serial_out(up, UART_IER, up->ier); 2148 serial_port_out(port, UART_IER, up->ier);
2151 2149
2152 if (port->flags & UPF_FOURPORT) { 2150 if (port->flags & UPF_FOURPORT) {
2153 unsigned int icp; 2151 unsigned int icp;
@@ -2172,7 +2170,7 @@ static void serial8250_shutdown(struct uart_port *port)
2172 * Disable interrupts from this port 2170 * Disable interrupts from this port
2173 */ 2171 */
2174 up->ier = 0; 2172 up->ier = 0;
2175 serial_out(up, UART_IER, 0); 2173 serial_port_out(port, UART_IER, 0);
2176 2174
2177 spin_lock_irqsave(&port->lock, flags); 2175 spin_lock_irqsave(&port->lock, flags);
2178 if (port->flags & UPF_FOURPORT) { 2176 if (port->flags & UPF_FOURPORT) {
@@ -2188,7 +2186,8 @@ static void serial8250_shutdown(struct uart_port *port)
2188 /* 2186 /*
2189 * Disable break condition and FIFOs 2187 * Disable break condition and FIFOs
2190 */ 2188 */
2191 serial_out(up, UART_LCR, serial_in(up, UART_LCR) & ~UART_LCR_SBC); 2189 serial_port_out(port, UART_LCR,
2190 serial_port_in(port, UART_LCR) & ~UART_LCR_SBC);
2192 serial8250_clear_fifos(up); 2191 serial8250_clear_fifos(up);
2193 2192
2194#ifdef CONFIG_SERIAL_8250_RSA 2193#ifdef CONFIG_SERIAL_8250_RSA
@@ -2202,7 +2201,7 @@ static void serial8250_shutdown(struct uart_port *port)
2202 * Read data port to reset things, and then unlink from 2201 * Read data port to reset things, and then unlink from
2203 * the IRQ chain. 2202 * the IRQ chain.
2204 */ 2203 */
2205 serial_in(up, UART_RX); 2204 serial_port_in(port, UART_RX);
2206 2205
2207 del_timer_sync(&up->timer); 2206 del_timer_sync(&up->timer);
2208 up->timer.function = serial8250_timeout; 2207 up->timer.function = serial8250_timeout;
@@ -2353,7 +2352,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
2353 if (up->capabilities & UART_CAP_RTOIE) 2352 if (up->capabilities & UART_CAP_RTOIE)
2354 up->ier |= UART_IER_RTOIE; 2353 up->ier |= UART_IER_RTOIE;
2355 2354
2356 serial_out(up, UART_IER, up->ier); 2355 serial_port_out(port, UART_IER, up->ier);
2357 2356
2358 if (up->capabilities & UART_CAP_EFR) { 2357 if (up->capabilities & UART_CAP_EFR) {
2359 unsigned char efr = 0; 2358 unsigned char efr = 0;
@@ -2365,11 +2364,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
2365 if (termios->c_cflag & CRTSCTS) 2364 if (termios->c_cflag & CRTSCTS)
2366 efr |= UART_EFR_CTS; 2365 efr |= UART_EFR_CTS;
2367 2366
2368 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 2367 serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
2369 if (port->flags & UPF_EXAR_EFR) 2368 if (port->flags & UPF_EXAR_EFR)
2370 serial_out(up, UART_XR_EFR, efr); 2369 serial_port_out(port, UART_XR_EFR, efr);
2371 else 2370 else
2372 serial_out(up, UART_EFR, efr); 2371 serial_port_out(port, UART_EFR, efr);
2373 } 2372 }
2374 2373
2375#ifdef CONFIG_ARCH_OMAP 2374#ifdef CONFIG_ARCH_OMAP
@@ -2377,18 +2376,20 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
2377 if (cpu_is_omap1510() && is_omap_port(up)) { 2376 if (cpu_is_omap1510() && is_omap_port(up)) {
2378 if (baud == 115200) { 2377 if (baud == 115200) {
2379 quot = 1; 2378 quot = 1;
2380 serial_out(up, UART_OMAP_OSC_12M_SEL, 1); 2379 serial_port_out(port, UART_OMAP_OSC_12M_SEL, 1);
2381 } else 2380 } else
2382 serial_out(up, UART_OMAP_OSC_12M_SEL, 0); 2381 serial_port_out(port, UART_OMAP_OSC_12M_SEL, 0);
2383 } 2382 }
2384#endif 2383#endif
2385 2384
2386 if (up->capabilities & UART_NATSEMI) { 2385 /*
2387 /* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */ 2386 * For NatSemi, switch to bank 2 not bank 1, to avoid resetting EXCR2,
2388 serial_out(up, UART_LCR, 0xe0); 2387 * otherwise just set DLAB
2389 } else { 2388 */
2390 serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ 2389 if (up->capabilities & UART_NATSEMI)
2391 } 2390 serial_port_out(port, UART_LCR, 0xe0);
2391 else
2392 serial_port_out(port, UART_LCR, cval | UART_LCR_DLAB);
2392 2393
2393 serial_dl_write(up, quot); 2394 serial_dl_write(up, quot);
2394 2395
@@ -2397,16 +2398,15 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
2397 * is written without DLAB set, this mode will be disabled. 2398 * is written without DLAB set, this mode will be disabled.
2398 */ 2399 */
2399 if (port->type == PORT_16750) 2400 if (port->type == PORT_16750)
2400 serial_out(up, UART_FCR, fcr); 2401 serial_port_out(port, UART_FCR, fcr);
2401 2402
2402 serial_out(up, UART_LCR, cval); /* reset DLAB */ 2403 serial_port_out(port, UART_LCR, cval); /* reset DLAB */
2403 up->lcr = cval; /* Save LCR */ 2404 up->lcr = cval; /* Save LCR */
2404 if (port->type != PORT_16750) { 2405 if (port->type != PORT_16750) {
2405 if (fcr & UART_FCR_ENABLE_FIFO) { 2406 /* emulated UARTs (Lucent Venus 167x) need two steps */
2406 /* emulated UARTs (Lucent Venus 167x) need two steps */ 2407 if (fcr & UART_FCR_ENABLE_FIFO)
2407 serial_out(up, UART_FCR, UART_FCR_ENABLE_FIFO); 2408 serial_port_out(port, UART_FCR, UART_FCR_ENABLE_FIFO);
2408 } 2409 serial_port_out(port, UART_FCR, fcr); /* set fcr */
2409 serial_out(up, UART_FCR, fcr); /* set fcr */
2410 } 2410 }
2411 serial8250_set_mctrl(port, port->mctrl); 2411 serial8250_set_mctrl(port, port->mctrl);
2412 spin_unlock_irqrestore(&port->lock, flags); 2412 spin_unlock_irqrestore(&port->lock, flags);
@@ -2788,7 +2788,7 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)
2788 container_of(port, struct uart_8250_port, port); 2788 container_of(port, struct uart_8250_port, port);
2789 2789
2790 wait_for_xmitr(up, UART_LSR_THRE); 2790 wait_for_xmitr(up, UART_LSR_THRE);
2791 serial_out(up, UART_TX, ch); 2791 serial_port_out(port, UART_TX, ch);
2792} 2792}
2793 2793
2794/* 2794/*
@@ -2820,12 +2820,12 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2820 /* 2820 /*
2821 * First save the IER then disable the interrupts 2821 * First save the IER then disable the interrupts
2822 */ 2822 */
2823 ier = serial_in(up, UART_IER); 2823 ier = serial_port_in(port, UART_IER);
2824 2824
2825 if (up->capabilities & UART_CAP_UUE) 2825 if (up->capabilities & UART_CAP_UUE)
2826 serial_out(up, UART_IER, UART_IER_UUE); 2826 serial_port_out(port, UART_IER, UART_IER_UUE);
2827 else 2827 else
2828 serial_out(up, UART_IER, 0); 2828 serial_port_out(port, UART_IER, 0);
2829 2829
2830 uart_console_write(port, s, count, serial8250_console_putchar); 2830 uart_console_write(port, s, count, serial8250_console_putchar);
2831 2831
@@ -2834,7 +2834,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2834 * and restore the IER 2834 * and restore the IER
2835 */ 2835 */
2836 wait_for_xmitr(up, BOTH_EMPTY); 2836 wait_for_xmitr(up, BOTH_EMPTY);
2837 serial_out(up, UART_IER, ier); 2837 serial_port_out(port, UART_IER, ier);
2838 2838
2839 /* 2839 /*
2840 * The receive handling will happen properly because the 2840 * The receive handling will happen properly because the
@@ -2996,11 +2996,11 @@ void serial8250_resume_port(int line)
2996 2996
2997 if (up->capabilities & UART_NATSEMI) { 2997 if (up->capabilities & UART_NATSEMI) {
2998 /* Ensure it's still in high speed mode */ 2998 /* Ensure it's still in high speed mode */
2999 serial_out(up, UART_LCR, 0xE0); 2999 serial_port_out(port, UART_LCR, 0xE0);
3000 3000
3001 ns16550a_goto_highspeed(up); 3001 ns16550a_goto_highspeed(up);
3002 3002
3003 serial_out(up, UART_LCR, 0); 3003 serial_port_out(port, UART_LCR, 0);
3004 port->uartclk = 921600*16; 3004 port->uartclk = 921600*16;
3005 } 3005 }
3006 uart_resume_port(&serial8250_reg, port); 3006 uart_resume_port(&serial8250_reg, port);