[PATCH v2 15/25] memconsole: fix __iomem mishandling, switch to memremap

From
Sergei Shtylyov <hidden>
Date
2015-07-25 22:02:39
Also in
linux-arch, lkml, nvdimm
Reply to
Dan Williams, 2015-07-25
Hello.

On 07/25/2015 05:39 AM, Dan Williams wrote:
The memconsole driver is not using proper accessors for __iomem.  Switch
to memremap to fix this issue, and this also prepares the driver for the
removal of ioremap_cache.
Cc: Mike Waychison <redacted>
Signed-off-by: Dan Williams <redacted>
---
  drivers/firmware/google/memconsole.c |    7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)
quoted hunk ↗ jump to hunk
diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c
index 2f569aaed4c7..1b25fba84f32 100644
--- a/drivers/firmware/google/memconsole.c
+++ b/drivers/firmware/google/memconsole.c
@@ -52,14 +52,15 @@ static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
  	char *memconsole;
  	ssize_t ret;

-	memconsole = ioremap_cache(memconsole_baseaddr, memconsole_length);
+	memconsole = memremap(memconsole_baseaddr, memconsole_length,
+			MEMREMAP_CACHE);
    Could you maintain the existing style of the broken line alignment in this 
file?
quoted hunk ↗ jump to hunk
  	if (!memconsole) {
-		pr_err("memconsole: ioremap_cache failed\n");
+		pr_err("memconsole: memremap failed\n");
  		return -ENOMEM;
  	}
  	ret = memory_read_from_buffer(buf, count, &pos, memconsole,
  				      memconsole_length);
    Here's an example...
quoted hunk ↗ jump to hunk
-	iounmap(memconsole);
+	memunmap(memconsole);
  	return ret;
  }
MBR, Sergei
Thread (67 messages) 67 messages, 10 authors, last reply 2016-04-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help