public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: matthias.kaehlcke@gmail.com
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Subject: [patch 2/3] MBCS: Convert dmawritelock to mutex
Date: Wed, 24 Oct 2007 19:09:33 +0200	[thread overview]
Message-ID: <20071024170933.GJ9824@traven> (raw)
In-Reply-To: 20071024170049.949862374@gmail.com

[-- Attachment #1: char-mbcs-dmawritelock-to-mutex --]
[-- Type: text/plain, Size: 1916 bytes --]

MBCS: Convert the semaphore dmawritelock to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>

Index: kernel/linux-2.6/drivers/char/mbcs.h
===================================================================
--- kernel.orig/linux-2.6/drivers/char/mbcs.h	2007-10-23 17:50:50.000000000 +0200
+++ kernel/linux-2.6/drivers/char/mbcs.h	2007-10-24 17:02:12.000000000 +0200
@@ -537,7 +537,7 @@
 	atomic_t dmawrite_done;
 	atomic_t dmaread_done;
 	atomic_t algo_done;
-	struct semaphore dmawritelock;
+	struct mutex dmawritelock;
 	struct semaphore dmareadlock;
 	struct mutex algolock;
 };
Index: kernel/linux-2.6/drivers/char/mbcs.c
===================================================================
--- kernel.orig/linux-2.6/drivers/char/mbcs.c	2007-10-23 17:50:50.000000000 +0200
+++ kernel/linux-2.6/drivers/char/mbcs.c	2007-10-24 17:02:12.000000000 +0200
@@ -311,7 +311,7 @@
 {
 	int rv = 0;
 
-	if (down_interruptible(&soft->dmawritelock))
+	if (mutex_lock_interruptible(&soft->dmawritelock))
 		return -ERESTARTSYS;
 
 	atomic_set(&soft->dmawrite_done, 0);
@@ -337,7 +337,7 @@
 	*off += len;
 
 dmawrite_exit:
-	up(&soft->dmawritelock);
+	mutex_unlock(&soft->dmawritelock);
 
 	return rv;
 }
@@ -764,7 +764,7 @@
 	init_waitqueue_head(&soft->dmaread_queue);
 	init_waitqueue_head(&soft->algo_queue);
 
-	init_MUTEX(&soft->dmawritelock);
+	mutex_init(&soft->dmawritelock);
 	init_MUTEX(&soft->dmareadlock);
 	mutex_init(&soft->algolock);
 

-- 
Matthias Kaehlcke
Linux Application Developer
Barcelona

              We build too many walls and not enough bridges
                             (Isaac Newton)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

  parent reply	other threads:[~2007-10-24 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071024170049.949862374@gmail.com>
2007-10-24 17:09 ` [patch 1/3] MBCS: Convert algolock to mutex matthias.kaehlcke
2007-10-24 17:09 ` matthias.kaehlcke [this message]
2007-10-24 17:09 ` [patch 3/3] MBCS: Convert dmareadlock " matthias.kaehlcke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071024170933.GJ9824@traven \
    --to=matthias.kaehlcke@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox