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 {
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;
}
}
......
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