staging: dgap: remove unnecessary if statement for checking NULL
authorDaeseok Youn <daeseok.youn@gmail.com>
Wed, 8 Oct 2014 11:12:48 +0000 (20:12 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:26 +0000 (10:29 +0800)
dgap_release_remap() function is only called after the memory
has been remapped so if statement for checking NULL doesn't
need.

And also release_mem_region() calls are moved after iounmap() calls.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c

index 2f2aa59600e53e48ab32dd74871aa70c26b8d94f..38077878f61a64bac78d51f82b7a8bc24fc0ac85 100644 (file)
@@ -1013,15 +1013,10 @@ static int dgap_do_remap(struct board_t *brd)
 
 static void dgap_release_remap(struct board_t *brd)
 {
-       if (brd->re_map_membase) {
-               release_mem_region(brd->membase, 0x200000);
-               iounmap(brd->re_map_membase);
-       }
-
-       if (brd->re_map_port) {
-               release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
-               iounmap(brd->re_map_port);
-       }
+       iounmap(brd->re_map_port);
+       iounmap(brd->re_map_membase);
+       release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
+       release_mem_region(brd->membase, 0x200000);
 }
 /*****************************************************************************
 *