Commit 7d3da090 authored by Miguel Gómez's avatar Miguel Gómez Committed by Greg Kroah-Hartman

Staging: ipack/bridges/tpci200: remove gotos in tpci200_free_irq().

Handle error conditions with simple returns instead of usig gotos.
Signed-off-by: default avatarMiguel Gómez <magomez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4bf8523d
...@@ -512,24 +512,19 @@ static void __tpci200_free_irq(struct tpci200_board *tpci200, ...@@ -512,24 +512,19 @@ static void __tpci200_free_irq(struct tpci200_board *tpci200,
static int tpci200_free_irq(struct ipack_device *dev) static int tpci200_free_irq(struct ipack_device *dev)
{ {
int res;
struct slot_irq *slot_irq; struct slot_irq *slot_irq;
struct tpci200_board *tpci200; struct tpci200_board *tpci200;
tpci200 = check_slot(dev); tpci200 = check_slot(dev);
if (tpci200 == NULL) { if (tpci200 == NULL)
res = -EINVAL; return -EINVAL;
goto out;
}
if (mutex_lock_interruptible(&tpci200->mutex)) { if (mutex_lock_interruptible(&tpci200->mutex))
res = -ERESTARTSYS; return -ERESTARTSYS;
goto out;
}
if (tpci200->slots[dev->slot].irq == NULL) { if (tpci200->slots[dev->slot].irq == NULL) {
res = -EINVAL; mutex_unlock(&tpci200->mutex);
goto out_unlock; return -EINVAL;
} }
__tpci200_free_irq(tpci200, dev); __tpci200_free_irq(tpci200, dev);
...@@ -537,10 +532,8 @@ static int tpci200_free_irq(struct ipack_device *dev) ...@@ -537,10 +532,8 @@ static int tpci200_free_irq(struct ipack_device *dev)
tpci200->slots[dev->slot].irq = NULL; tpci200->slots[dev->slot].irq = NULL;
kfree(slot_irq); kfree(slot_irq);
out_unlock:
mutex_unlock(&tpci200->mutex); mutex_unlock(&tpci200->mutex);
out: return 0;
return res;
} }
static int tpci200_slot_unmap_space(struct ipack_device *dev, int space) static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment