aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/lparcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/lparcfg.c')
-rw-r--r--arch/powerpc/kernel/lparcfg.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 89486b631284..c492cee90e0f 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -130,30 +130,31 @@ static int iseries_lparcfg_data(struct seq_file *m, void *v)
130/* 130/*
131 * Methods used to fetch LPAR data when running on a pSeries platform. 131 * Methods used to fetch LPAR data when running on a pSeries platform.
132 */ 132 */
133/* find a better place for this function... */
134static void log_plpar_hcall_return(unsigned long rc, char *tag) 133static void log_plpar_hcall_return(unsigned long rc, char *tag)
135{ 134{
136 if (rc == 0) /* success, return */ 135 switch(rc) {
136 case 0:
137 return; 137 return;
138/* check for null tag ? */ 138 case H_HARDWARE:
139 if (rc == H_HARDWARE) 139 printk(KERN_INFO "plpar-hcall (%s) "
140 printk(KERN_INFO 140 "Hardware fault\n", tag);
141 "plpar-hcall (%s) failed with hardware fault\n", tag); 141 return;
142 else if (rc == H_FUNCTION) 142 case H_FUNCTION:
143 printk(KERN_INFO 143 printk(KERN_INFO "plpar-hcall (%s) "
144 "plpar-hcall (%s) failed; function not allowed\n", tag); 144 "Function not allowed\n", tag);
145 else if (rc == H_AUTHORITY) 145 return;
146 printk(KERN_INFO 146 case H_AUTHORITY:
147 "plpar-hcall (%s) failed; not authorized to this" 147 printk(KERN_INFO "plpar-hcall (%s) "
148 " function\n", tag); 148 "Not authorized to this function\n", tag);
149 else if (rc == H_PARAMETER) 149 return;
150 printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", 150 case H_PARAMETER:
151 tag); 151 printk(KERN_INFO "plpar-hcall (%s) "
152 else 152 "Bad parameter(s)\n",tag);
153 printk(KERN_INFO 153 return;
154 "plpar-hcall (%s) failed with unexpected rc(0x%lx)\n", 154 default:
155 tag, rc); 155 printk(KERN_INFO "plpar-hcall (%s) "
156 156 "Unexpected rc(0x%lx)\n", tag, rc);
157 }
157} 158}
158 159
159/* 160/*
@@ -321,15 +322,16 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
321 struct device_node *rtas_node; 322 struct device_node *rtas_node;
322 const int *lrdrp = NULL; 323 const int *lrdrp = NULL;
323 324
324 rtas_node = find_path_device("/rtas"); 325 rtas_node = of_find_node_by_path("/rtas");
325 if (rtas_node) 326 if (rtas_node)
326 lrdrp = get_property(rtas_node, "ibm,lrdr-capacity", NULL); 327 lrdrp = of_get_property(rtas_node, "ibm,lrdr-capacity", NULL);
327 328
328 if (lrdrp == NULL) { 329 if (lrdrp == NULL) {
329 partition_potential_processors = vdso_data->processorCount; 330 partition_potential_processors = vdso_data->processorCount;
330 } else { 331 } else {
331 partition_potential_processors = *(lrdrp + 4); 332 partition_potential_processors = *(lrdrp + 4);
332 } 333 }
334 of_node_put(rtas_node);
333 335
334 partition_active_processors = lparcfg_count_active_processors(); 336 partition_active_processors = lparcfg_count_active_processors();
335 337
@@ -537,25 +539,27 @@ static int lparcfg_data(struct seq_file *m, void *v)
537 539
538 seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS); 540 seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);
539 541
540 rootdn = find_path_device("/"); 542 rootdn = of_find_node_by_path("/");
541 if (rootdn) { 543 if (rootdn) {
542 tmp = get_property(rootdn, "model", NULL); 544 tmp = of_get_property(rootdn, "model", NULL);
543 if (tmp) { 545 if (tmp) {
544 model = tmp; 546 model = tmp;
545 /* Skip "IBM," - see platforms/iseries/dt.c */ 547 /* Skip "IBM," - see platforms/iseries/dt.c */
546 if (firmware_has_feature(FW_FEATURE_ISERIES)) 548 if (firmware_has_feature(FW_FEATURE_ISERIES))
547 model += 4; 549 model += 4;
548 } 550 }
549 tmp = get_property(rootdn, "system-id", NULL); 551 tmp = of_get_property(rootdn, "system-id", NULL);
550 if (tmp) { 552 if (tmp) {
551 system_id = tmp; 553 system_id = tmp;
552 /* Skip "IBM," - see platforms/iseries/dt.c */ 554 /* Skip "IBM," - see platforms/iseries/dt.c */
553 if (firmware_has_feature(FW_FEATURE_ISERIES)) 555 if (firmware_has_feature(FW_FEATURE_ISERIES))
554 system_id += 4; 556 system_id += 4;
555 } 557 }
556 lp_index_ptr = get_property(rootdn, "ibm,partition-no", NULL); 558 lp_index_ptr = of_get_property(rootdn, "ibm,partition-no",
559 NULL);
557 if (lp_index_ptr) 560 if (lp_index_ptr)
558 lp_index = *lp_index_ptr; 561 lp_index = *lp_index_ptr;
562 of_node_put(rootdn);
559 } 563 }
560 seq_printf(m, "serial_number=%s\n", system_id); 564 seq_printf(m, "serial_number=%s\n", system_id);
561 seq_printf(m, "system_type=%s\n", model); 565 seq_printf(m, "system_type=%s\n", model);