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 14/45] drivers: tty: serial: vr41xx_siu: 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/vr41xx_siu.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c
index 6d106e3..3f69603 100644
--- a/drivers/tty/serial/vr41xx_siu.c
+++ b/drivers/tty/serial/vr41xx_siu.c
@@ -617,12 +617,12 @@ static void siu_release_port(struct uart_port *port)
unsigned long size;

if (port->flags & UPF_IOREMAP) {
- iounmap(port->membase);
+ devm_iounmap(port->dev, port->membase);
port->membase = NULL;
}

size = siu_port_size(port);
- release_mem_region(port->mapbase, size);
+ devm_release_mem_region(port->dev, port->mapbase, size);
}

static int siu_request_port(struct uart_port *port)
@@ -631,12 +631,15 @@ static int siu_request_port(struct uart_port *port)
struct resource *res;

size = siu_port_size(port);
- res = request_mem_region(port->mapbase, size, siu_type_name(port));
+ res = devm_request_mem_region(port->dev,
+ port->mapbase,
+ size,
+ siu_type_name(port));
if (res == NULL)
return -EBUSY;

if (port->flags & UPF_IOREMAP) {
- port->membase = ioremap(port->mapbase, size);
+ port->membase = devm_ioremap(port->dev, port->mapbase, size);
if (port->membase == NULL) {
release_resource(res);
return -ENOMEM;
--
1.9.1
\
 
 \ /
  Last update: 2019-03-14 23:38    [W:0.137 / U:4.124 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site