diff options
author | Daeseok Youn <daeseok.youn@gmail.com> | 2014-12-26 10:34:32 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-17 16:10:48 -0800 |
commit | aa9895da3e2e6aa2674ffa54b3b927503cc47b49 (patch) | |
tree | 795a3c3a9c419c13316a384c67848db7574d51c0 /drivers/staging/dgap | |
parent | 7f703fae17d53adadaa9e71af174c51f2655e680 (diff) |
staging: dgap: use gotos for handling error in dgap_remap()
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r-- | drivers/staging/dgap/dgap.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index bdb5317e3d9d..518ab567ca4e 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -1400,27 +1400,27 @@ static int dgap_remap(struct board_t *brd) return -ENOMEM; if (!request_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000, - "dgap")) { - release_mem_region(brd->membase, 0x200000); - return -ENOMEM; - } + "dgap")) + goto err_req_mem; brd->re_map_membase = ioremap(brd->membase, 0x200000); - if (!brd->re_map_membase) { - release_mem_region(brd->membase, 0x200000); - release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000); - return -ENOMEM; - } + if (!brd->re_map_membase) + goto err_remap_mem; brd->re_map_port = ioremap((brd->membase + PCI_IO_OFFSET), 0x200000); - if (!brd->re_map_port) { - release_mem_region(brd->membase, 0x200000); - release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000); - iounmap(brd->re_map_membase); - return -ENOMEM; - } + if (!brd->re_map_port) + goto err_remap_port; return 0; + +err_remap_port: + iounmap(brd->re_map_membase); +err_remap_mem: + release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000); +err_req_mem: + release_mem_region(brd->membase, 0x200000); + + return -ENOMEM; } static void dgap_unmap(struct board_t *brd) |