Commit 75d1e661 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: unisys: memregion: Eliminate unnecessary 'requested' flag

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1bd14f37
...@@ -29,7 +29,6 @@ struct memregion { ...@@ -29,7 +29,6 @@ struct memregion {
HOSTADDRESS physaddr; HOSTADDRESS physaddr;
ulong nbytes; ulong nbytes;
void __iomem *mapped; void __iomem *mapped;
BOOL requested;
}; };
static int mapit(struct memregion *memregion); static int mapit(struct memregion *memregion);
...@@ -67,16 +66,12 @@ mapit(struct memregion *memregion) ...@@ -67,16 +66,12 @@ mapit(struct memregion *memregion)
ulong physaddr = (ulong)(memregion->physaddr); ulong physaddr = (ulong)(memregion->physaddr);
ulong nbytes = memregion->nbytes; ulong nbytes = memregion->nbytes;
memregion->requested = FALSE;
if (!request_mem_region(physaddr, nbytes, MYDRVNAME)) if (!request_mem_region(physaddr, nbytes, MYDRVNAME))
return -EBUSY; return -EBUSY;
memregion->requested = TRUE;
memregion->mapped = ioremap_cache(physaddr, nbytes); memregion->mapped = ioremap_cache(physaddr, nbytes);
if (!memregion->mapped) { if (!memregion->mapped)
memregion->requested = TRUE;
return -EFAULT; return -EFAULT;
}
return 0; return 0;
} }
...@@ -84,14 +79,11 @@ mapit(struct memregion *memregion) ...@@ -84,14 +79,11 @@ mapit(struct memregion *memregion)
static void static void
unmapit(struct memregion *memregion) unmapit(struct memregion *memregion)
{ {
if (memregion->mapped != NULL) { if (memregion->mapped) {
iounmap(memregion->mapped); iounmap(memregion->mapped);
memregion->mapped = NULL; memregion->mapped = NULL;
} release_mem_region((unsigned long)memregion->physaddr,
if (memregion->requested) {
release_mem_region((ulong)(memregion->physaddr),
memregion->nbytes); memregion->nbytes);
memregion->requested = FALSE;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment