Fix incorrect use of mutex_trylock().
Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return -EINVAL;
}
- if (mutex_trylock(&(list->mtx))) {
+ if (!mutex_trylock(&(list->mtx))) {
printk("Link List already submitted\n");
return -EINVAL;
}
return -EINVAL;
}
- if (mutex_trylock(&(list->mtx))) {
+ if (!mutex_trylock(&(list->mtx))) {
printk("Link List in use\n");
return -EINVAL;
}
ctrlr = list_entry(resource->entry, struct vme_dma_resource, list);
- if (mutex_trylock(&(ctrlr->mtx))) {
+ if (!mutex_trylock(&(ctrlr->mtx))) {
printk("Resource busy, can't free\n");
return -EBUSY;
}