Commit 3d73f32b authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Greg Kroah-Hartman

serial: sh-sci: Don't rely on platform data flags when not needed

The UPF_BOOT_AUTOCONF platform data flag is set by all platforms,
hardcode it.

The UPF_IOREMAP flag is set by a single SH platform and thus needs to be
kept. However, for ARM platforms, we can base the decision on whether an
OF node is present and bypass the platform data flags completely.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f8325b3
...@@ -2455,7 +2455,7 @@ static int sci_remap_port(struct uart_port *port) ...@@ -2455,7 +2455,7 @@ static int sci_remap_port(struct uart_port *port)
if (port->membase) if (port->membase)
return 0; return 0;
if (port->flags & UPF_IOREMAP) { if (port->dev->of_node || (port->flags & UPF_IOREMAP)) {
port->membase = ioremap_nocache(port->mapbase, sport->reg_size); port->membase = ioremap_nocache(port->mapbase, sport->reg_size);
if (unlikely(!port->membase)) { if (unlikely(!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);
...@@ -2477,7 +2477,7 @@ static void sci_release_port(struct uart_port *port) ...@@ -2477,7 +2477,7 @@ static void sci_release_port(struct uart_port *port)
{ {
struct sci_port *sport = to_sci_port(port); struct sci_port *sport = to_sci_port(port);
if (port->flags & UPF_IOREMAP) { if (port->dev->of_node || (port->flags & UPF_IOREMAP)) {
iounmap(port->membase); iounmap(port->membase);
port->membase = NULL; port->membase = NULL;
} }
...@@ -2733,7 +2733,7 @@ static int sci_init_single(struct platform_device *dev, ...@@ -2733,7 +2733,7 @@ static int sci_init_single(struct platform_device *dev,
} }
port->type = p->type; port->type = p->type;
port->flags = UPF_FIXED_PORT | p->flags; port->flags = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags;
port->regshift = p->regshift; port->regshift = p->regshift;
/* /*
...@@ -2995,7 +2995,6 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id) ...@@ -2995,7 +2995,6 @@ sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id)
*dev_id = id; *dev_id = id;
p->flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
p->type = SCI_OF_TYPE(match->data); p->type = SCI_OF_TYPE(match->data);
p->regtype = SCI_OF_REGTYPE(match->data); p->regtype = SCI_OF_REGTYPE(match->data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment