diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-19 03:51:37 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-19 03:51:37 -0500 |
commit | e8183a6c6238a192fba32ac47d75fd076ca487a6 (patch) | |
tree | 838ae23f63d26435c917403b850669c9629e21cb | |
parent | 86b7d0e288c326d3ea7c22600cb7b6d84abb2968 (diff) |
serial: sh-sci: Fix up ioremap handling.
We were using an IS_ERR() check for the ioremap case, presumably because
this matched the old custom ioremap call that sh64 was providing. Now
that all ioremap() implementations trap the IS_ERR case and hand back a
NULL, check for that instead.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | drivers/serial/sh-sci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 31ac092b16d8..44d5bd10702b 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -1482,6 +1482,7 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps, | |||
1482 | 1482 | ||
1483 | /* Warn, but use a safe default */ | 1483 | /* Warn, but use a safe default */ |
1484 | WARN_ON(1); | 1484 | WARN_ON(1); |
1485 | |||
1485 | return ((freq + 16 * bps) / (32 * bps) - 1); | 1486 | return ((freq + 16 * bps) / (32 * bps) - 1); |
1486 | } | 1487 | } |
1487 | 1488 | ||
@@ -1517,6 +1518,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1517 | sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST); | 1518 | sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST); |
1518 | 1519 | ||
1519 | smr_val = sci_in(port, SCSMR) & 3; | 1520 | smr_val = sci_in(port, SCSMR) & 3; |
1521 | |||
1520 | if ((termios->c_cflag & CSIZE) == CS7) | 1522 | if ((termios->c_cflag & CSIZE) == CS7) |
1521 | smr_val |= 0x40; | 1523 | smr_val |= 0x40; |
1522 | if (termios->c_cflag & PARENB) | 1524 | if (termios->c_cflag & PARENB) |
@@ -1612,8 +1614,7 @@ static void sci_config_port(struct uart_port *port, int flags) | |||
1612 | 1614 | ||
1613 | if (port->flags & UPF_IOREMAP) { | 1615 | if (port->flags & UPF_IOREMAP) { |
1614 | port->membase = ioremap_nocache(port->mapbase, 0x40); | 1616 | port->membase = ioremap_nocache(port->mapbase, 0x40); |
1615 | 1617 | if (unlikely(!port->membase)) | |
1616 | if (IS_ERR(port->membase)) | ||
1617 | dev_err(port->dev, "can't remap port#%d\n", port->line); | 1618 | dev_err(port->dev, "can't remap port#%d\n", port->line); |
1618 | } else { | 1619 | } else { |
1619 | /* | 1620 | /* |