From: Dave Young <hidave.darkstar@gmail.com>
To: dbrownell@users.sourceforge.net
Cc: linux-kernel@vger.kernel.org, spi-devel-general@lists.sourceforge.net
Subject: [PATCH 11/12] spi : Use mutex instead of semaphore in driver core
Date: Sat, 29 Dec 2007 09:18:58 +0800 [thread overview]
Message-ID: <20071229011858.GL2883@darkstar.te-china.tietoenator.com> (raw)
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
drivers/spi/spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -upr linux/drivers/spi/spi.c linux.new/drivers/spi/spi.c
--- linux/drivers/spi/spi.c 2007-12-28 10:47:38.000000000 +0800
+++ linux.new/drivers/spi/spi.c 2007-12-28 10:48:22.000000000 +0800
@@ -494,7 +494,7 @@ struct spi_master *spi_busnum_to_master(
struct spi_master *master = NULL;
struct spi_master *m;
- down(&spi_master_class.sem);
+ mutex_lock(&spi_master_class.mutex);
list_for_each_entry(dev, &spi_master_class.children, node) {
m = container_of(dev, struct spi_master, dev);
if (m->bus_num == bus_num) {
@@ -502,7 +502,7 @@ struct spi_master *spi_busnum_to_master(
break;
}
}
- up(&spi_master_class.sem);
+ mutex_unlock(&spi_master_class.mutex);
return master;
}
EXPORT_SYMBOL_GPL(spi_busnum_to_master);
next reply other threads:[~2007-12-29 1:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-29 1:18 Dave Young [this message]
2007-12-29 1:37 ` David Brownell
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=20071229011858.GL2883@darkstar.te-china.tietoenator.com \
--to=hidave.darkstar@gmail.com \
--cc=dbrownell@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®