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

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jes Sorensen 2015-05-05 18:36:24 -04:00 committed by Greg Kroah-Hartman
parent 1bd14f3704
commit 75d1e6613c

View File

@ -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;
}
}