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>
This commit is contained in:
Paul Mundt 2011-01-19 17:51:37 +09:00
parent 86b7d0e288
commit e8183a6c62
1 changed files with 3 additions and 2 deletions

View File

@ -1482,6 +1482,7 @@ static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
/* Warn, but use a safe default */ /* Warn, but use a safe default */
WARN_ON(1); WARN_ON(1);
return ((freq + 16 * bps) / (32 * bps) - 1); return ((freq + 16 * bps) / (32 * bps) - 1);
} }
@ -1517,6 +1518,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST); sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST);
smr_val = sci_in(port, SCSMR) & 3; smr_val = sci_in(port, SCSMR) & 3;
if ((termios->c_cflag & CSIZE) == CS7) if ((termios->c_cflag & CSIZE) == CS7)
smr_val |= 0x40; smr_val |= 0x40;
if (termios->c_cflag & PARENB) if (termios->c_cflag & PARENB)
@ -1612,8 +1614,7 @@ static void sci_config_port(struct uart_port *port, int flags)
if (port->flags & UPF_IOREMAP) { if (port->flags & UPF_IOREMAP) {
port->membase = ioremap_nocache(port->mapbase, 0x40); port->membase = ioremap_nocache(port->mapbase, 0x40);
if (unlikely(!port->membase))
if (IS_ERR(port->membase))
dev_err(port->dev, "can't remap port#%d\n", port->line); dev_err(port->dev, "can't remap port#%d\n", port->line);
} else { } else {
/* /*