diff options
-rw-r--r-- | drivers/char/mbcs.c | 7 | ||||
-rw-r--r-- | drivers/char/mbcs.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 3c5802ae1716..035575c041cd 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
25 | #include <linux/uio.h> | 25 | #include <linux/uio.h> |
26 | #include <linux/mutex.h> | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
@@ -281,7 +282,7 @@ static inline int mbcs_algo_start(struct mbcs_soft *soft) | |||
281 | void *mmr_base = soft->mmr_base; | 282 | void *mmr_base = soft->mmr_base; |
282 | union cm_control cm_control; | 283 | union cm_control cm_control; |
283 | 284 | ||
284 | if (down_interruptible(&soft->algolock)) | 285 | if (mutex_lock_interruptible(&soft->algolock)) |
285 | return -ERESTARTSYS; | 286 | return -ERESTARTSYS; |
286 | 287 | ||
287 | atomic_set(&soft->algo_done, 0); | 288 | atomic_set(&soft->algo_done, 0); |
@@ -298,7 +299,7 @@ static inline int mbcs_algo_start(struct mbcs_soft *soft) | |||
298 | cm_control.alg_go = 1; | 299 | cm_control.alg_go = 1; |
299 | MBCS_MMR_SET(mmr_base, MBCS_CM_CONTROL, cm_control.cm_control_reg); | 300 | MBCS_MMR_SET(mmr_base, MBCS_CM_CONTROL, cm_control.cm_control_reg); |
300 | 301 | ||
301 | up(&soft->algolock); | 302 | mutex_unlock(&soft->algolock); |
302 | 303 | ||
303 | return 0; | 304 | return 0; |
304 | } | 305 | } |
@@ -764,7 +765,7 @@ static int mbcs_probe(struct cx_dev *dev, const struct cx_device_id *id) | |||
764 | 765 | ||
765 | init_MUTEX(&soft->dmawritelock); | 766 | init_MUTEX(&soft->dmawritelock); |
766 | init_MUTEX(&soft->dmareadlock); | 767 | init_MUTEX(&soft->dmareadlock); |
767 | init_MUTEX(&soft->algolock); | 768 | mutex_init(&soft->algolock); |
768 | 769 | ||
769 | mbcs_getdma_init(&soft->getdma); | 770 | mbcs_getdma_init(&soft->getdma); |
770 | mbcs_putdma_init(&soft->putdma); | 771 | mbcs_putdma_init(&soft->putdma); |
diff --git a/drivers/char/mbcs.h b/drivers/char/mbcs.h index c9905a3c3353..d4d97abbce7f 100644 --- a/drivers/char/mbcs.h +++ b/drivers/char/mbcs.h | |||
@@ -539,7 +539,7 @@ struct mbcs_soft { | |||
539 | atomic_t algo_done; | 539 | atomic_t algo_done; |
540 | struct semaphore dmawritelock; | 540 | struct semaphore dmawritelock; |
541 | struct semaphore dmareadlock; | 541 | struct semaphore dmareadlock; |
542 | struct semaphore algolock; | 542 | struct mutex algolock; |
543 | }; | 543 | }; |
544 | 544 | ||
545 | static int mbcs_open(struct inode *ip, struct file *fp); | 545 | static int mbcs_open(struct inode *ip, struct file *fp); |