aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-02-05 02:35:47 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-19 22:10:19 -0400
commitda19cbcf71cde3c09587b5924d113f0c7f1fd23a (patch)
treef1731d6a0f8606afcc283c5540055d8e56bb7309 /drivers/base/memory.c
parent610ad5064cb90aec35f5837bbde3d316fe02aca7 (diff)
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/memory.c')
-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 @@
20#include <linux/kobject.h> 20#include <linux/kobject.h>
21#include <linux/memory_hotplug.h> 21#include <linux/memory_hotplug.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/mutex.h>
23#include <asm/atomic.h> 24#include <asm/atomic.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25 26
@@ -205,7 +206,7 @@ static int memory_block_change_state(struct memory_block *mem,
205 unsigned long to_state, unsigned long from_state_req) 206 unsigned long to_state, unsigned long from_state_req)
206{ 207{
207 int ret = 0; 208 int ret = 0;
208 down(&mem->state_sem); 209 mutex_lock(&mem->state_mutex);
209 210
210 if (mem->state != from_state_req) { 211 if (mem->state != from_state_req) {
211 ret = -EINVAL; 212 ret = -EINVAL;
@@ -217,7 +218,7 @@ static int memory_block_change_state(struct memory_block *mem,
217 mem->state = to_state; 218 mem->state = to_state;
218 219
219out: 220out:
220 up(&mem->state_sem); 221 mutex_unlock(&mem->state_mutex);
221 return ret; 222 return ret;
222} 223}
223 224
@@ -341,7 +342,7 @@ static int add_memory_block(unsigned long node_id, struct mem_section *section,
341 342
342 mem->phys_index = __section_nr(section); 343 mem->phys_index = __section_nr(section);
343 mem->state = state; 344 mem->state = state;
344 init_MUTEX(&mem->state_sem); 345 mutex_init(&mem->state_mutex);
345 mem->phys_device = phys_device; 346 mem->phys_device = phys_device;
346 347
347 ret = register_memory(mem, section, NULL); 348 ret = register_memory(mem, section, NULL);