Skip to contentSkip to conversation

ARM: meson: serial: convert iounmap to devm_iounmap

PATCH New Firo Yang 1 participant 1 message Apr 26, 2015

Subsystems (3)
lore
Share & tools
lore

Firo Yang

author
#0 lore raw

PATCH 1/1 ARM: meson: serial: convert iounmap to devm_iounmap

The function meson_uart_release_port() inappropriately try to iounmap() a resource managed by devm_ioremap_nocache(). The function meson_uart_release_port() maybe called by uart_ioctl() that means meson_uart_release_port() is not called from within a probe or remove function, for safety, I convert iounmap() to devm_iounmap().

---
 drivers/tty/serial/meson_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/meson_uart.c +1 -1
index 67c0367..0fc83c9 100644
@@ -370,7 +370,7 @@ 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) {
-		iounmap(port->membase);
+		devm_iounmap(port->dev, port->membase);
 		port->membase = NULL;
 	}
 }
Signature · 1 line
2.1.0