summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/esas2r/esas2r_ioctl.c
diff options
context:
space:
mode:
authorBinoy Jayan2017-06-08 12:07:31 +0200
committerMartin K. Petersen2017-06-13 03:17:22 +0200
commit249cf320bd5dd3490252cb9f3cdef41f7d1caacc (patch)
treeeddce6a8756bb0d7e902e87dae13292f220b3c36 /drivers/scsi/esas2r/esas2r_ioctl.c
parentscsi: esas2r: Replace semaphore fm_api_semaphore with mutex (diff)
downloadkernel-qcow2-linux-249cf320bd5dd3490252cb9f3cdef41f7d1caacc.tar.gz
kernel-qcow2-linux-249cf320bd5dd3490252cb9f3cdef41f7d1caacc.tar.xz
kernel-qcow2-linux-249cf320bd5dd3490252cb9f3cdef41f7d1caacc.zip
scsi: esas2r: Replace semaphore fs_api_semaphore with mutex
The semaphore 'fs_api_semaphore' is used as a simple mutex, so it should be written as one. Semaphores are going away in the future. Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/esas2r/esas2r_ioctl.c')
-rw-r--r--drivers/scsi/esas2r/esas2r_ioctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c
index c6b041a9f007..97623002908f 100644
--- a/drivers/scsi/esas2r/esas2r_ioctl.c
+++ b/drivers/scsi/esas2r/esas2r_ioctl.c
@@ -1962,7 +1962,7 @@ int esas2r_read_fs(struct esas2r_adapter *a, char *buf, long off, int count)
(struct esas2r_ioctl_fs *)a->fs_api_buffer;
/* If another flash request is already in progress, return. */
- if (down_interruptible(&a->fs_api_semaphore)) {
+ if (mutex_lock_interruptible(&a->fs_api_mutex)) {
busy:
fs->status = ATTO_STS_OUT_OF_RSRC;
return -EBUSY;
@@ -1978,7 +1978,7 @@ busy:
rq = esas2r_alloc_request(a);
if (rq == NULL) {
esas2r_debug("esas2r_read_fs: out of requests");
- up(&a->fs_api_semaphore);
+ mutex_unlock(&a->fs_api_mutex);
goto busy;
}
@@ -2006,7 +2006,7 @@ busy:
;
dont_wait:
/* Free the request and keep going */
- up(&a->fs_api_semaphore);
+ mutex_unlock(&a->fs_api_mutex);
esas2r_free_request(a, (struct esas2r_request *)rq);
/* Pick up possible error code from above */