From: Jes Sorensen Date: Tue, 5 May 2015 22:36:24 +0000 (-0400) Subject: staging: unisys: memregion: Eliminate unnecessary 'requested' flag X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=75d1e6613c3ae4728c0ff15e23ab4226e8dfbfcf;p=openwrt%2Fstaging%2Fblogic.git staging: unisys: memregion: Eliminate unnecessary 'requested' flag Signed-off-by: Jes Sorensen Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- 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; } }