From 75d1e6613c3ae4728c0ff15e23ab4226e8dfbfcf Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Tue, 5 May 2015 18:36:24 -0400 Subject: [PATCH] staging: unisys: memregion: Eliminate unnecessary 'requested' flag Signed-off-by: Jes Sorensen Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- .../staging/unisys/visorutil/memregion_direct.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c b/drivers/staging/unisys/visorutil/memregion_direct.c index 7ba68bcef371..0ee7cb2fafd0 100644 --- a/drivers/staging/unisys/visorutil/memregion_direct.c +++ b/drivers/staging/unisys/visorutil/memregion_direct.c @@ -29,7 +29,6 @@ struct memregion { HOSTADDRESS physaddr; ulong nbytes; void __iomem *mapped; - BOOL requested; }; static int mapit(struct memregion *memregion); @@ -67,16 +66,12 @@ mapit(struct memregion *memregion) ulong physaddr = (ulong)(memregion->physaddr); ulong nbytes = memregion->nbytes; - memregion->requested = FALSE; if (!request_mem_region(physaddr, nbytes, MYDRVNAME)) return -EBUSY; - memregion->requested = TRUE; memregion->mapped = ioremap_cache(physaddr, nbytes); - if (!memregion->mapped) { - memregion->requested = TRUE; + if (!memregion->mapped) return -EFAULT; - } return 0; } @@ -84,14 +79,11 @@ mapit(struct memregion *memregion) static void unmapit(struct memregion *memregion) { - if (memregion->mapped != NULL) { + if (memregion->mapped) { iounmap(memregion->mapped); memregion->mapped = NULL; - } - if (memregion->requested) { - release_mem_region((ulong)(memregion->physaddr), + release_mem_region((unsigned long)memregion->physaddr, memregion->nbytes); - memregion->requested = FALSE; } } -- 2.30.2