aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptctl.c')
-rw-r--r--drivers/message/fusion/mptctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 7c340240a50e..bdf709987982 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -177,10 +177,10 @@ mptctl_syscall_down(MPT_ADAPTER *ioc, int nonblock)
177 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock)); 177 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down(%p,%d) called\n", ioc, nonblock));
178 178
179 if (nonblock) { 179 if (nonblock) {
180 if (down_trylock(&ioc->ioctl->sem_ioc)) 180 if (!mutex_trylock(&ioc->ioctl->ioctl_mutex))
181 rc = -EAGAIN; 181 rc = -EAGAIN;
182 } else { 182 } else {
183 if (down_interruptible(&ioc->ioctl->sem_ioc)) 183 if (mutex_lock_interruptible(&ioc->ioctl->ioctl_mutex))
184 rc = -ERESTARTSYS; 184 rc = -ERESTARTSYS;
185 } 185 }
186 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc)); 186 dctlprintk((KERN_INFO MYNAM "::mptctl_syscall_down return %d\n", rc));
@@ -557,7 +557,7 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
557 else 557 else
558 ret = -EINVAL; 558 ret = -EINVAL;
559 559
560 up(&iocp->ioctl->sem_ioc); 560 mutex_unlock(&iocp->ioctl->ioctl_mutex);
561 561
562 return ret; 562 return ret;
563} 563}
@@ -2619,7 +2619,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd,
2619 2619
2620 ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); 2620 ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);
2621 2621
2622 up(&iocp->ioctl->sem_ioc); 2622 mutex_unlock(&iocp->ioctl->ioctl_mutex);
2623 2623
2624 return ret; 2624 return ret;
2625} 2625}
@@ -2673,7 +2673,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd,
2673 */ 2673 */
2674 ret = mptctl_do_mpt_command (karg, &uarg->MF); 2674 ret = mptctl_do_mpt_command (karg, &uarg->MF);
2675 2675
2676 up(&iocp->ioctl->sem_ioc); 2676 mutex_unlock(&iocp->ioctl->ioctl_mutex);
2677 2677
2678 return ret; 2678 return ret;
2679} 2679}
@@ -2743,7 +2743,7 @@ mptctl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2743 memset(mem, 0, sz); 2743 memset(mem, 0, sz);
2744 ioc->ioctl = (MPT_IOCTL *) mem; 2744 ioc->ioctl = (MPT_IOCTL *) mem;
2745 ioc->ioctl->ioc = ioc; 2745 ioc->ioctl->ioc = ioc;
2746 sema_init(&ioc->ioctl->sem_ioc, 1); 2746 mutex_init(&ioc->ioctl->ioctl_mutex);
2747 return 0; 2747 return 0;
2748 2748
2749out_fail: 2749out_fail: