[PATCH 049/141] staging: unisys: visorchipset: Use ioremap direction rather than heavy visor_memregion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
---
 drivers/staging/unisys/visorbus/visorchipset.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 2be8514..9390ed6 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -397,9 +397,7 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
 	int allocbytes = sizeof(struct parser_context) + bytes;
 	struct parser_context *rc = NULL;
 	struct parser_context *ctx = NULL;
-	struct memregion *rgn = NULL;
 	struct spar_controlvm_parameters_header *phdr = NULL;
-	int cnt;
 
 	if (retry)
 		*retry = false;
@@ -438,18 +436,21 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
 		p = __va((unsigned long) (addr));
 		memcpy(ctx->data, p, bytes);
 	} else {
-		rgn = visor_memregion_create(addr, bytes);
-		if (!rgn) {
+		void __iomem *mapping;
+
+		if (!request_mem_region(addr, bytes, "visorchipset")) {
 			rc = NULL;
 			goto cleanup;
 		}
-		cnt = visor_memregion_read(rgn, 0, ctx->data, bytes);
-		visor_memregion_destroy(rgn);
 
-		if (cnt < 0) {
+		mapping = ioremap_cache(addr, bytes);
+		if (!mapping) {
+			release_mem_region(addr, bytes);
 			rc = NULL;
 			goto cleanup;
 		}
+		memcpy_fromio(ctx->data, mapping, bytes);
+		release_mem_region(addr, bytes);
 	}
 	if (!standard_payload_header) {
 		ctx->byte_stream = true;
-- 
2.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux