Loading drivers/serial/sh-sci.c +20 −34 Original line number Original line Diff line number Diff line Loading @@ -994,9 +994,21 @@ static void sci_config_port(struct uart_port *port, int flags) port->type = s->type; port->type = s->type; if (port->flags & UPF_IOREMAP && !port->membase) { if (port->membase) return; if (port->flags & UPF_IOREMAP) { port->membase = ioremap_nocache(port->mapbase, 0x40); port->membase = ioremap_nocache(port->mapbase, 0x40); 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 { /* * For the simple (and majority of) cases where we don't * need to do any remapping, just cast the cookie * directly. */ port->membase = (void __iomem *)port->mapbase; } } } } Loading Loading @@ -1036,7 +1048,7 @@ static struct uart_ops sci_uart_ops = { #endif #endif }; }; static int __devinit sci_init_single(struct sci_port *sci_port, static void __devinit sci_init_single(struct sci_port *sci_port, unsigned int index, unsigned int index, struct plat_sci_port *p) struct plat_sci_port *p) { { Loading Loading @@ -1069,22 +1081,6 @@ static int __devinit sci_init_single(struct sci_port *sci_port, init_timer(&sci_port->break_timer); init_timer(&sci_port->break_timer); sci_port->port.mapbase = p->mapbase; sci_port->port.mapbase = p->mapbase; if (p->mapbase && !p->membase) { if (p->flags & UPF_IOREMAP) { p->membase = ioremap_nocache(p->mapbase, 0x40); if (IS_ERR(p->membase)) return PTR_ERR(p->membase); } else { /* * For the simple (and majority of) cases * where we don't need to do any remapping, * just cast the cookie directly. */ p->membase = (void __iomem *)p->mapbase; } } sci_port->port.membase = p->membase; sci_port->port.membase = p->membase; sci_port->port.irq = p->irqs[SCIx_TXI_IRQ]; sci_port->port.irq = p->irqs[SCIx_TXI_IRQ]; Loading @@ -1092,8 +1088,6 @@ static int __devinit sci_init_single(struct sci_port *sci_port, sci_port->type = sci_port->port.type = p->type; sci_port->type = sci_port->port.type = p->type; memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); return 0; } } #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE Loading Loading @@ -1163,7 +1157,6 @@ static int __init serial_console_setup(struct console *co, char *options) sci_port->clk = clk_get(NULL, "module_clk"); sci_port->clk = clk_get(NULL, "module_clk"); #endif #endif if (port->flags & UPF_IOREMAP) sci_config_port(port, 0); sci_config_port(port, 0); if (sci_port->enable) if (sci_port->enable) Loading Loading @@ -1258,18 +1251,11 @@ static int __devinit sci_probe_single(struct platform_device *dev, } } sciport->port.dev = &dev->dev; sciport->port.dev = &dev->dev; ret = sci_init_single(sciport, index, p); sci_init_single(sciport, index, p); if (ret) return ret; ret = uart_add_one_port(&sci_uart_driver, &sciport->port); ret = uart_add_one_port(&sci_uart_driver, &sciport->port); if (ret) if (ret) { if (p->flags & UPF_IOREMAP) iounmap(p->membase); return ret; return ret; } INIT_LIST_HEAD(&sciport->node); INIT_LIST_HEAD(&sciport->node); Loading Loading
drivers/serial/sh-sci.c +20 −34 Original line number Original line Diff line number Diff line Loading @@ -994,9 +994,21 @@ static void sci_config_port(struct uart_port *port, int flags) port->type = s->type; port->type = s->type; if (port->flags & UPF_IOREMAP && !port->membase) { if (port->membase) return; if (port->flags & UPF_IOREMAP) { port->membase = ioremap_nocache(port->mapbase, 0x40); port->membase = ioremap_nocache(port->mapbase, 0x40); 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 { /* * For the simple (and majority of) cases where we don't * need to do any remapping, just cast the cookie * directly. */ port->membase = (void __iomem *)port->mapbase; } } } } Loading Loading @@ -1036,7 +1048,7 @@ static struct uart_ops sci_uart_ops = { #endif #endif }; }; static int __devinit sci_init_single(struct sci_port *sci_port, static void __devinit sci_init_single(struct sci_port *sci_port, unsigned int index, unsigned int index, struct plat_sci_port *p) struct plat_sci_port *p) { { Loading Loading @@ -1069,22 +1081,6 @@ static int __devinit sci_init_single(struct sci_port *sci_port, init_timer(&sci_port->break_timer); init_timer(&sci_port->break_timer); sci_port->port.mapbase = p->mapbase; sci_port->port.mapbase = p->mapbase; if (p->mapbase && !p->membase) { if (p->flags & UPF_IOREMAP) { p->membase = ioremap_nocache(p->mapbase, 0x40); if (IS_ERR(p->membase)) return PTR_ERR(p->membase); } else { /* * For the simple (and majority of) cases * where we don't need to do any remapping, * just cast the cookie directly. */ p->membase = (void __iomem *)p->mapbase; } } sci_port->port.membase = p->membase; sci_port->port.membase = p->membase; sci_port->port.irq = p->irqs[SCIx_TXI_IRQ]; sci_port->port.irq = p->irqs[SCIx_TXI_IRQ]; Loading @@ -1092,8 +1088,6 @@ static int __devinit sci_init_single(struct sci_port *sci_port, sci_port->type = sci_port->port.type = p->type; sci_port->type = sci_port->port.type = p->type; memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); return 0; } } #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE Loading Loading @@ -1163,7 +1157,6 @@ static int __init serial_console_setup(struct console *co, char *options) sci_port->clk = clk_get(NULL, "module_clk"); sci_port->clk = clk_get(NULL, "module_clk"); #endif #endif if (port->flags & UPF_IOREMAP) sci_config_port(port, 0); sci_config_port(port, 0); if (sci_port->enable) if (sci_port->enable) Loading Loading @@ -1258,18 +1251,11 @@ static int __devinit sci_probe_single(struct platform_device *dev, } } sciport->port.dev = &dev->dev; sciport->port.dev = &dev->dev; ret = sci_init_single(sciport, index, p); sci_init_single(sciport, index, p); if (ret) return ret; ret = uart_add_one_port(&sci_uart_driver, &sciport->port); ret = uart_add_one_port(&sci_uart_driver, &sciport->port); if (ret) if (ret) { if (p->flags & UPF_IOREMAP) iounmap(p->membase); return ret; return ret; } INIT_LIST_HEAD(&sciport->node); INIT_LIST_HEAD(&sciport->node); Loading