summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Jennings <sjenning@linux.vnet.ibm.com>2013-08-20 19:12:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-21 20:48:40 +0200
commitdf2b717c667d2cab37d1bbd585e891f10ed2bca4 (patch)
tree674e6ca90b95714a634f19e88a7197f6b56ea651
parentdrivers: base: remove unneeded variable (diff)
downloadlinux-df2b717c667d2cab37d1bbd585e891f10ed2bca4.tar.xz
linux-df2b717c667d2cab37d1bbd585e891f10ed2bca4.zip
drivers: base: use device get/put functions
Use the [get|put]_device functions for ref'ing the memory block device rather than the kobject functions which should be hidden away by the device layer. Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index b31d998a63a5..e97519bc3d06 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -616,14 +616,14 @@ static int add_memory_section(int nid, struct mem_section *section,
if (scn_nr >= (*mem_p)->start_section_nr &&
scn_nr <= (*mem_p)->end_section_nr) {
mem = *mem_p;
- kobject_get(&mem->dev.kobj);
+ get_device(&mem->dev);
}
} else
mem = find_memory_block(section);
if (mem) {
mem->section_count++;
- kobject_put(&mem->dev.kobj);
+ put_device(&mem->dev);
} else {
ret = init_memory_block(&mem, section, state);
/* store memory_block pointer for next loop */
@@ -663,7 +663,7 @@ unregister_memory(struct memory_block *memory)
BUG_ON(memory->dev.bus != &memory_subsys);
/* drop the ref. we got in remove_memory_block() */
- kobject_put(&memory->dev.kobj);
+ put_device(&memory->dev);
device_unregister(&memory->dev);
}
@@ -680,7 +680,7 @@ static int remove_memory_block(unsigned long node_id,
if (mem->section_count == 0)
unregister_memory(mem);
else
- kobject_put(&mem->dev.kobj);
+ put_device(&mem->dev);
mutex_unlock(&mem_sysfs_mutex);
return 0;