summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>2012-05-23 13:54:42 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-07 05:14:07 (GMT)
commit38f1c53df288b56ad4b8421b13fbdb7232e92270 (patch)
treedb530175923fe350c714b0af2e684aa3585ed9c5 /drivers
parentbe98cc1daa0419f31472c21e45aec30d24fa5931 (diff)
downloadlinux-fsl-qoriq-38f1c53df288b56ad4b8421b13fbdb7232e92270.tar.xz
Staging: ipack/bridges/tpci200: tpci200_slot_unmap_space() should return 0 if succeed.
tpci200_slot_unmap_space() should return 0 if the operation was properly done. If not, the caller will think that something wrong happened. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/ipack/bridges/tpci200.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c
index 75ed600..85560c7 100644
--- a/drivers/staging/ipack/bridges/tpci200.c
+++ b/drivers/staging/ipack/bridges/tpci200.c
@@ -551,20 +551,15 @@ out:
static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
{
- int res;
struct ipack_addr_space *virt_addr_space;
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;
switch (space) {
case IPACK_IO_SPACE:
@@ -594,9 +589,8 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
default:
pr_err("Slot [%d:%d] space number %d doesn't exist !\n",
dev->bus_nr, dev->slot, space);
- res = -EINVAL;
- goto out_unlock;
- break;
+ mutex_unlock(&tpci200->mutex);
+ return -EINVAL;
}
iounmap(virt_addr_space->address);
@@ -605,8 +599,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
virt_addr_space->size = 0;
out_unlock:
mutex_unlock(&tpci200->mutex);
-out:
- return res;
+ return 0;
}
static int tpci200_slot_unregister(struct ipack_device *dev)