Skip to contentSkip to conversation

serial: mxs-auart: Use devm_ioremap() to fix the missing undo bug

PATCH New Chuhong Yuan 1 participant 1 message Jun 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: mxs-auart: Use devm_ioremap() to fix the missing undo bug

This driver calls ioremap() in probe, but it misses calling iounmap() in probe's error handler and remove.
Replace ioremap() with the devm version to fix it.

Fixes 47d37d6f94cc ("serial: Add auart driver for i.MX23/28")
---
 drivers/tty/serial/mxs-auart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/mxs-auart.c +1 -1
index b4f835e7de23..b3e16fd72eaf 100644
@@ -1679,7 +1679,7 @@ static int mxs_auart_probe(struct platform_device *pdev)
 	}
 
 	s->port.mapbase = r->start;
-	s->port.membase = ioremap(r->start, resource_size(r));
+	s->port.membase = devm_ioremap(&pdev->dev, r->start, resource_size(r));
 	if (!s->port.membase) {
 		ret = -ENOMEM;
 		goto out_disable_clks;
Signature · 1 line
2.26.2