summary refs log tree commit diff
path: root/drivers/base
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-02-04 23:35:47 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-19 19:10:19 -0700
commitda19cbcf71cde3c09587b5924d113f0c7f1fd23a (patch)
treef1731d6a0f8606afcc283c5540055d8e56bb7309 /drivers/base
parent610ad5064cb90aec35f5837bbde3d316fe02aca7 (diff)
downloadlinux-da19cbcf71cde3c09587b5924d113f0c7f1fd23a.tar.gz
driver core: memory: semaphore to mutex
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/memory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 7ae413fdd5fc..1f3801a8184d 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -20,6 +20,7 @@
 #include <linux/kobject.h>
 #include <linux/memory_hotplug.h>
 #include <linux/mm.h>
+#include <linux/mutex.h>
 #include <asm/atomic.h>
 #include <asm/uaccess.h>
 
@@ -205,7 +206,7 @@ static int memory_block_change_state(struct memory_block *mem,
 		unsigned long to_state, unsigned long from_state_req)
 {
 	int ret = 0;
-	down(&mem->state_sem);
+	mutex_lock(&mem->state_mutex);
 
 	if (mem->state != from_state_req) {
 		ret = -EINVAL;
@@ -217,7 +218,7 @@ static int memory_block_change_state(struct memory_block *mem,
 		mem->state = to_state;
 
 out:
-	up(&mem->state_sem);
+	mutex_unlock(&mem->state_mutex);
 	return ret;
 }
 
@@ -341,7 +342,7 @@ static int add_memory_block(unsigned long node_id, struct mem_section *section,
 
 	mem->phys_index = __section_nr(section);
 	mem->state = state;
-	init_MUTEX(&mem->state_sem);
+	mutex_init(&mem->state_mutex);
 	mem->phys_device = phys_device;
 
 	ret = register_memory(mem, section, NULL);