Commit 74d2fd48 authored by Binoy Jayan's avatar Binoy Jayan Committed by Martin K. Petersen

scsi: esas2r: Replace semaphore fm_api_semaphore with mutex

The semaphore 'fm_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: default avatarBinoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4fae52b5
......@@ -945,7 +945,7 @@ struct esas2r_adapter {
struct list_head vrq_mds_head;
struct esas2r_mem_desc *vrq_mds;
int num_vrqs;
struct semaphore fm_api_semaphore;
struct mutex fm_api_mutex;
struct semaphore fs_api_semaphore;
struct semaphore nvram_semaphore;
struct atto_ioctl *local_atto_ioctl;
......
......@@ -327,7 +327,7 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid,
esas2r_debug("new adapter %p, name %s", a, a->name);
spin_lock_init(&a->request_lock);
spin_lock_init(&a->fw_event_lock);
sema_init(&a->fm_api_semaphore, 1);
mutex_init(&a->fm_api_mutex);
sema_init(&a->fs_api_semaphore, 1);
sema_init(&a->nvram_semaphore, 1);
......
......@@ -110,7 +110,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)
{
struct esas2r_request *rq;
if (down_interruptible(&a->fm_api_semaphore)) {
if (mutex_lock_interruptible(&a->fm_api_mutex)) {
fi->status = FI_STAT_BUSY;
return;
}
......@@ -173,7 +173,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi)
free_req:
esas2r_free_request(a, (struct esas2r_request *)rq);
free_sem:
up(&a->fm_api_semaphore);
mutex_unlock(&a->fm_api_mutex);
return;
}
......
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