lkml.org 
[lkml]   [2019]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 39/45] drivers: tty: serial: efm32-uart: use devm_* functions
Date
Use the safer devm versions of memory mapping functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
drivers/tty/serial/efm32-uart.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c
index d6b5e54..a79cadc 100644
--- a/drivers/tty/serial/efm32-uart.c
+++ b/drivers/tty/serial/efm32-uart.c
@@ -437,7 +437,7 @@ static void efm32_uart_release_port(struct uart_port *port)

clk_unprepare(efm_port->clk);
clk_put(efm_port->clk);
- iounmap(port->membase);
+ devm_iounmap(port->dev, port->membase);
}

static int efm32_uart_request_port(struct uart_port *port)
@@ -445,7 +445,7 @@ static int efm32_uart_request_port(struct uart_port *port)
struct efm32_uart_port *efm_port = to_efm_port(port);
int ret;

- port->membase = ioremap(port->mapbase, 60);
+ port->membase = devm_ioremap(port->dev, port->mapbase, 60);
if (!efm_port->port.membase) {
ret = -ENOMEM;
efm_debug(efm_port, "failed to remap\n");
@@ -464,7 +464,7 @@ static int efm32_uart_request_port(struct uart_port *port)
clk_put(efm_port->clk);
err_clk_get:

- iounmap(port->membase);
+ devm_iounmap(port->dev, port->membase);
err_ioremap:
return ret;
}
--
1.9.1
\
 
 \ /
  Last update: 2019-03-14 23:36    [W:0.144 / U:1.628 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site