diff options
| author | Seth Jennings <sjenning@linux.vnet.ibm.com> | 2013-08-20 13:12:59 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-21 14:48:40 -0400 |
| commit | df2b717c667d2cab37d1bbd585e891f10ed2bca4 (patch) | |
| tree | 674e6ca90b95714a634f19e88a7197f6b56ea651 /drivers/base | |
| parent | 879f1bec8e136c7bc71e38715e62a73b75f91d78 (diff) | |
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>
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/memory.c | 8 |
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, | |||
| 616 | if (scn_nr >= (*mem_p)->start_section_nr && | 616 | if (scn_nr >= (*mem_p)->start_section_nr && |
| 617 | scn_nr <= (*mem_p)->end_section_nr) { | 617 | scn_nr <= (*mem_p)->end_section_nr) { |
| 618 | mem = *mem_p; | 618 | mem = *mem_p; |
| 619 | kobject_get(&mem->dev.kobj); | 619 | get_device(&mem->dev); |
| 620 | } | 620 | } |
| 621 | } else | 621 | } else |
| 622 | mem = find_memory_block(section); | 622 | mem = find_memory_block(section); |
| 623 | 623 | ||
| 624 | if (mem) { | 624 | if (mem) { |
| 625 | mem->section_count++; | 625 | mem->section_count++; |
| 626 | kobject_put(&mem->dev.kobj); | 626 | put_device(&mem->dev); |
| 627 | } else { | 627 | } else { |
| 628 | ret = init_memory_block(&mem, section, state); | 628 | ret = init_memory_block(&mem, section, state); |
| 629 | /* store memory_block pointer for next loop */ | 629 | /* store memory_block pointer for next loop */ |
| @@ -663,7 +663,7 @@ unregister_memory(struct memory_block *memory) | |||
| 663 | BUG_ON(memory->dev.bus != &memory_subsys); | 663 | BUG_ON(memory->dev.bus != &memory_subsys); |
| 664 | 664 | ||
| 665 | /* drop the ref. we got in remove_memory_block() */ | 665 | /* drop the ref. we got in remove_memory_block() */ |
| 666 | kobject_put(&memory->dev.kobj); | 666 | put_device(&memory->dev); |
| 667 | device_unregister(&memory->dev); | 667 | device_unregister(&memory->dev); |
| 668 | } | 668 | } |
| 669 | 669 | ||
| @@ -680,7 +680,7 @@ static int remove_memory_block(unsigned long node_id, | |||
| 680 | if (mem->section_count == 0) | 680 | if (mem->section_count == 0) |
| 681 | unregister_memory(mem); | 681 | unregister_memory(mem); |
| 682 | else | 682 | else |
| 683 | kobject_put(&mem->dev.kobj); | 683 | put_device(&mem->dev); |
| 684 | 684 | ||
| 685 | mutex_unlock(&mem_sysfs_mutex); | 685 | mutex_unlock(&mem_sysfs_mutex); |
| 686 | return 0; | 686 | return 0; |
