From 14cc3e2b633bb64063698980974df4535368e98f Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 26 Mar 2006 01:37:14 -0800 Subject: [PATCH] sem2mutex: misc static one-file mutexes Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar Cc: Dave Jones Cc: Paul Mackerras Cc: Ralf Baechle Cc: Jens Axboe Cc: Neil Brown Acked-by: Alasdair G Kergon Cc: Greg KH Cc: Dominik Brodowski Cc: Adam Belay Cc: Martin Schwidefsky Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/macintosh/smu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/macintosh/smu.c') diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 4eb05d7143d8..f4516ca7aa3a 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -92,7 +93,7 @@ struct smu_device { * for now, just hard code that */ static struct smu_device *smu; -static DECLARE_MUTEX(smu_part_access); +static DEFINE_MUTEX(smu_part_access); static void smu_i2c_retry(unsigned long data); @@ -976,11 +977,11 @@ struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size, if (interruptible) { int rc; - rc = down_interruptible(&smu_part_access); + rc = mutex_lock_interruptible(&smu_part_access); if (rc) return ERR_PTR(rc); } else - down(&smu_part_access); + mutex_lock(&smu_part_access); part = (struct smu_sdbp_header *)get_property(smu->of_node, pname, size); @@ -990,7 +991,7 @@ struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size, if (part != NULL && size) *size = part->len << 2; } - up(&smu_part_access); + mutex_unlock(&smu_part_access); return part; } -- cgit v1.2.3