Commit 38f1c53d authored by Samuel Iglesias Gonsalvez's avatar Samuel Iglesias Gonsalvez Committed by Greg Kroah-Hartman

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: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be98cc1d
...@@ -551,20 +551,15 @@ static int tpci200_free_irq(struct ipack_device *dev) ...@@ -551,20 +551,15 @@ static int tpci200_free_irq(struct ipack_device *dev)
static int tpci200_slot_unmap_space(struct ipack_device *dev, int space) static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
{ {
int res;
struct ipack_addr_space *virt_addr_space; struct ipack_addr_space *virt_addr_space;
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;
}
switch (space) { switch (space) {
case IPACK_IO_SPACE: case IPACK_IO_SPACE:
...@@ -594,9 +589,8 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space) ...@@ -594,9 +589,8 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
default: default:
pr_err("Slot [%d:%d] space number %d doesn't exist !\n", pr_err("Slot [%d:%d] space number %d doesn't exist !\n",
dev->bus_nr, dev->slot, space); dev->bus_nr, dev->slot, space);
res = -EINVAL; mutex_unlock(&tpci200->mutex);
goto out_unlock; return -EINVAL;
break;
} }
iounmap(virt_addr_space->address); iounmap(virt_addr_space->address);
...@@ -605,8 +599,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space) ...@@ -605,8 +599,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
virt_addr_space->size = 0; virt_addr_space->size = 0;
out_unlock: out_unlock:
mutex_unlock(&tpci200->mutex); mutex_unlock(&tpci200->mutex);
out: return 0;
return res;
} }
static int tpci200_slot_unregister(struct ipack_device *dev) static int tpci200_slot_unregister(struct ipack_device *dev)
......
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