diff options
author | Miguel Gómez <magomez@igalia.com> | 2012-06-07 09:10:17 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-09 15:57:37 (GMT) |
commit | 7d3da090cdcf400178b81f851c3721e2bbb9fce9 (patch) | |
tree | 289f602a263152cb37a8f1cc09a20203e546d7a7 /drivers/staging/ipack | |
parent | 4bf8523df925869d4d27478105f23656a2411ce0 (diff) | |
download | linux-fsl-qoriq-7d3da090cdcf400178b81f851c3721e2bbb9fce9.tar.xz |
Staging: ipack/bridges/tpci200: remove gotos in tpci200_free_irq().
Handle error conditions with simple returns instead of usig gotos.
Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ipack')
-rw-r--r-- | drivers/staging/ipack/bridges/tpci200.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c index c39499a..68bcc55 100644 --- a/drivers/staging/ipack/bridges/tpci200.c +++ b/drivers/staging/ipack/bridges/tpci200.c @@ -512,24 +512,19 @@ static void __tpci200_free_irq(struct tpci200_board *tpci200, static int tpci200_free_irq(struct ipack_device *dev) { - int res; struct slot_irq *slot_irq; struct tpci200_board *tpci200; tpci200 = check_slot(dev); - if (tpci200 == NULL) { - res = -EINVAL; - goto out; - } + if (tpci200 == NULL) + return -EINVAL; - if (mutex_lock_interruptible(&tpci200->mutex)) { - res = -ERESTARTSYS; - goto out; - } + if (mutex_lock_interruptible(&tpci200->mutex)) + return -ERESTARTSYS; if (tpci200->slots[dev->slot].irq == NULL) { - res = -EINVAL; - goto out_unlock; + mutex_unlock(&tpci200->mutex); + return -EINVAL; } __tpci200_free_irq(tpci200, dev); @@ -537,10 +532,8 @@ static int tpci200_free_irq(struct ipack_device *dev) tpci200->slots[dev->slot].irq = NULL; kfree(slot_irq); -out_unlock: mutex_unlock(&tpci200->mutex); -out: - return res; + return 0; } static int tpci200_slot_unmap_space(struct ipack_device *dev, int space) |