aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r--drivers/base/node.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 54e5d8eaf70e..44eed11bbdf3 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -312,6 +312,7 @@ static int get_nid_for_pfn(unsigned long pfn)
312/* register memory section under specified node if it spans that node */ 312/* register memory section under specified node if it spans that node */
313int register_mem_sect_under_node(struct memory_block *mem_blk, int nid) 313int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
314{ 314{
315 int ret;
315 unsigned long pfn, sect_start_pfn, sect_end_pfn; 316 unsigned long pfn, sect_start_pfn, sect_end_pfn;
316 317
317 if (!mem_blk) 318 if (!mem_blk)
@@ -328,9 +329,15 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
328 continue; 329 continue;
329 if (page_nid != nid) 330 if (page_nid != nid)
330 continue; 331 continue;
331 return sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj, 332 ret = sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj,
332 &mem_blk->sysdev.kobj, 333 &mem_blk->sysdev.kobj,
333 kobject_name(&mem_blk->sysdev.kobj)); 334 kobject_name(&mem_blk->sysdev.kobj));
335 if (ret)
336 return ret;
337
338 return sysfs_create_link_nowarn(&mem_blk->sysdev.kobj,
339 &node_devices[nid].sysdev.kobj,
340 kobject_name(&node_devices[nid].sysdev.kobj));
334 } 341 }
335 /* mem section does not span the specified node */ 342 /* mem section does not span the specified node */
336 return 0; 343 return 0;
@@ -359,6 +366,8 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk)
359 continue; 366 continue;
360 sysfs_remove_link(&node_devices[nid].sysdev.kobj, 367 sysfs_remove_link(&node_devices[nid].sysdev.kobj,
361 kobject_name(&mem_blk->sysdev.kobj)); 368 kobject_name(&mem_blk->sysdev.kobj));
369 sysfs_remove_link(&mem_blk->sysdev.kobj,
370 kobject_name(&node_devices[nid].sysdev.kobj));
362 } 371 }
363 return 0; 372 return 0;
364} 373}