staging: unisys: memregion: Eliminate unnecessary 'requested' flag
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 5 May 2015 22:36:24 +0000 (18:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 May 2015 13:26:02 +0000 (15:26 +0200)
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>
drivers/staging/unisys/visorutil/memregion_direct.c

index 7ba68bcef3718114465ef22b910fcf77da3df880..0ee7cb2fafd04da648804c42924b81cea5966dcf 100644 (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;
        }
 }