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 37/45] drivers: tty: serial: apbuart: 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/apbuart.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 60cd133..5eaaee9 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -293,12 +293,15 @@ static const char *apbuart_type(struct uart_port *port)

static void apbuart_release_port(struct uart_port *port)
{
- release_mem_region(port->mapbase, 0x100);
+ devm_release_mem_region(port->dev, port->mapbase, 0x100);
}

static int apbuart_request_port(struct uart_port *port)
{
- return request_mem_region(port->mapbase, 0x100, "grlib-apbuart")
+ return devm_request_mem_region(port->dev,
+ port->mapbase,
+ 0x100,
+ "grlib-apbuart")
!= NULL ? 0 : -EBUSY;
return 0;
}
@@ -622,7 +625,9 @@ static int __init grlib_apbuart_configure(void)
port = &grlib_apbuart_ports[line];

port->mapbase = addr;
- port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map));
+ port->membase = devm_ioremap(port->dev,
+ addr,
+ sizeof(struct grlib_apbuart_regs_map));
port->irq = 0;
port->iotype = UPIO_MEM;
port->ops = &grlib_apbuart_ops;
--
1.9.1
\
 
 \ /
  Last update: 2019-03-14 23:37    [W:0.183 / U:2.984 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site