Skip to content

Commit ae5e297

Browse files
mkaehlckeLinus Torvalds
authored andcommitted
MBCS: convert dmareadlock to mutex
MBCS: Convert the semaphore dmareadlock to the mutex API Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 46bca69 commit ae5e297

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/char/mbcs.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ do_mbcs_sram_dmaread(struct mbcs_soft *soft, uint64_t hostAddr,
347347
{
348348
int rv = 0;
349349

350-
if (down_interruptible(&soft->dmareadlock))
350+
if (mutex_lock_interruptible(&soft->dmareadlock))
351351
return -ERESTARTSYS;
352352

353353
atomic_set(&soft->dmawrite_done, 0);
@@ -372,7 +372,7 @@ do_mbcs_sram_dmaread(struct mbcs_soft *soft, uint64_t hostAddr,
372372
*off += len;
373373

374374
dmaread_exit:
375-
up(&soft->dmareadlock);
375+
mutex_unlock(&soft->dmareadlock);
376376

377377
return rv;
378378
}
@@ -764,7 +764,7 @@ static int mbcs_probe(struct cx_dev *dev, const struct cx_device_id *id)
764764
init_waitqueue_head(&soft->algo_queue);
765765

766766
mutex_init(&soft->dmawritelock);
767-
init_MUTEX(&soft->dmareadlock);
767+
mutex_init(&soft->dmareadlock);
768768
mutex_init(&soft->algolock);
769769

770770
mbcs_getdma_init(&soft->getdma);

‎drivers/char/mbcs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ struct mbcs_soft {
538538
atomic_t dmaread_done;
539539
atomic_t algo_done;
540540
struct mutex dmawritelock;
541-
struct semaphore dmareadlock;
541+
struct mutex dmareadlock;
542542
struct mutex algolock;
543543
};
544544

0 commit comments

Comments
 (0)