From: hkallweit1@gmail.com (Heiner Kallweit)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH v2 5/6] serial: meson: remove use of flag UPF_IOREMAP
Date: Wed, 19 Apr 2017 22:17:50 +0200 [thread overview]
Message-ID: <9ca8e0bb-4caf-f541-5daa-9c48a06f2974@gmail.com> (raw)
In-Reply-To: <4abafe6e-3c7c-049f-d450-ab27e2c7acfd@gmail.com>
Flag UPF_IOREMAP is used by the 8250 subsystem only, it's not used
by the serial core. Therefore I don't see any benefit in using it
here.
In addition fix the order of calls in meson_uart_release_port.
Unmapping needs to be done first, reversing call order in
meson_uart_request_port.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- no changes
---
drivers/tty/serial/meson_uart.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 1220c9ac..171eb673 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -404,12 +404,9 @@ static int meson_uart_verify_port(struct uart_port *port,
static void meson_uart_release_port(struct uart_port *port)
{
- if (port->flags & UPF_IOREMAP) {
- devm_release_mem_region(port->dev, port->mapbase,
- port->mapsize);
- devm_iounmap(port->dev, port->membase);
- port->membase = NULL;
- }
+ devm_iounmap(port->dev, port->membase);
+ port->membase = NULL;
+ devm_release_mem_region(port->dev, port->mapbase, port->mapsize);
}
static int meson_uart_request_port(struct uart_port *port)
@@ -420,13 +417,10 @@ static int meson_uart_request_port(struct uart_port *port)
return -EBUSY;
}
- if (port->flags & UPF_IOREMAP) {
- port->membase = devm_ioremap_nocache(port->dev,
- port->mapbase,
- port->mapsize);
- if (port->membase == NULL)
- return -ENOMEM;
- }
+ port->membase = devm_ioremap_nocache(port->dev, port->mapbase,
+ port->mapsize);
+ if (!port->membase)
+ return -ENOMEM;
return 0;
}
@@ -623,7 +617,7 @@ static int meson_uart_probe(struct platform_device *pdev)
port->mapbase = res_mem->start;
port->mapsize = resource_size(res_mem);
port->irq = res_irq->start;
- port->flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_LOW_LATENCY;
+ port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
port->dev = &pdev->dev;
port->line = pdev->id;
port->type = PORT_MESON;
--
2.12.2
next prev parent reply other threads:[~2017-04-19 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 19:59 [PATCH v2 0/6] serial: meson: series with smaller fixes and improvements Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 1/6] serial: meson: fix setting number of stop bits Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 2/6] serial: meson: remove dead code in meson_uart_change_speed Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 3/6] serial: meson: remove unneeded variable assignment in meson_serial_port_write Heiner Kallweit
2017-04-19 20:17 ` [PATCH v2 4/6] serial: meson: make use of uart_port member mapsize Heiner Kallweit
2017-04-19 20:17 ` Heiner Kallweit [this message]
2017-04-19 20:18 ` [PATCH v2 6/6] serial: meson: change interrupt description to tty name Heiner Kallweit
2017-04-27 6:13 ` Yixun Lan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9ca8e0bb-4caf-f541-5daa-9c48a06f2974@gmail.com \
--to=hkallweit1@gmail.com \
--cc=linus-amlogic@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®