From: matthias.kaehlcke@gmail.com
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Subject: [patch 3/3] MBCS: Convert dmareadlock to mutex
Date: Wed, 24 Oct 2007 19:09:52 +0200 [thread overview]
Message-ID: <20071024170952.GK9824@traven> (raw)
In-Reply-To: 20071024170049.949862374@gmail.com
[-- Attachment #1: char-mbcs-dmareadlock-to-mutex --]
[-- Type: text/plain, Size: 1758 bytes --]
MBCS: Convert the semaphore dmareadlock to the mutex API
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
--- kernel.orig/linux-2.6/drivers/char/mbcs.c 2007-10-23 17:43:36.000000000 +0200
+++ kernel/linux-2.6/drivers/char/mbcs.c 2007-10-23 17:44:11.000000000 +0200
@@ -348,7 +348,7 @@
{
int rv = 0;
- if (down_interruptible(&soft->dmareadlock))
+ if (mutex_lock_interruptible(&soft->dmareadlock))
return -ERESTARTSYS;
atomic_set(&soft->dmawrite_done, 0);
@@ -373,7 +373,7 @@
*off += len;
dmaread_exit:
- up(&soft->dmareadlock);
+ mutex_unlock(&soft->dmareadlock);
return rv;
}
@@ -765,7 +765,7 @@
init_waitqueue_head(&soft->algo_queue);
mutex_init(&soft->dmawritelock);
- init_MUTEX(&soft->dmareadlock);
+ mutex_init(&soft->dmareadlock);
mutex_init(&soft->algolock);
mbcs_getdma_init(&soft->getdma);
Index: kernel/linux-2.6/drivers/char/mbcs.h
===================================================================
--- kernel.orig/linux-2.6/drivers/char/mbcs.h 2007-10-23 17:43:38.000000000 +0200
+++ kernel/linux-2.6/drivers/char/mbcs.h 2007-10-23 17:44:33.000000000 +0200
@@ -538,7 +538,7 @@
atomic_t dmaread_done;
atomic_t algo_done;
struct mutex dmawritelock;
- struct semaphore dmareadlock;
+ struct mutex dmareadlock;
struct mutex 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 `-
prev parent reply other threads:[~2007-10-24 17:10 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 ` [patch 2/3] MBCS: Convert dmawritelock " matthias.kaehlcke
2007-10-24 17:09 ` matthias.kaehlcke [this message]
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=20071024170952.GK9824@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