[PATCH] ppc64: fix PCI IO mapping
[powerpc.git] / arch / ppc64 / kernel / lparcfg.c
index 02e9662..a80ed30 100644 (file)
 #include <linux/init.h>
 #include <linux/seq_file.h>
 #include <asm/uaccess.h>
-#include <asm/iSeries/HvLpConfig.h>
+#include <asm/iseries/hv_lp_config.h>
 #include <asm/lppaca.h>
 #include <asm/hvcall.h>
-#include <asm/cputable.h>
+#include <asm/firmware.h>
 #include <asm/rtas.h>
 #include <asm/system.h>
 #include <asm/time.h>
-#include <asm/iSeries/ItExtVpdPanel.h>
+#include <asm/iseries/it_exp_vpd_panel.h>
 #include <asm/prom.h>
+#include <asm/systemcfg.h>
 
 #define MODULE_VERS "1.6"
 #define MODULE_NAME "lparcfg"
@@ -273,6 +274,7 @@ static void parse_system_parameter_string(struct seq_file *m)
                if (!workbuffer) {
                        printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
                               __FILE__, __FUNCTION__, __LINE__);
+                       kfree(local_buffer);                    
                        return;
                }
 #ifdef LPARCFG_DEBUG
@@ -370,14 +372,14 @@ static int lparcfg_data(struct seq_file *m, void *v)
        lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
 
        if (lrdrp == NULL) {
-               partition_potential_processors = systemcfg->processorCount;
+               partition_potential_processors = _systemcfg->processorCount;
        } else {
                partition_potential_processors = *(lrdrp + 4);
        }
 
        partition_active_processors = lparcfg_count_active_processors();
 
-       if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+       if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
                unsigned long h_entitled, h_unallocated;
                unsigned long h_aggregation, h_resource;
                unsigned long pool_idle_time, pool_procs;
@@ -568,10 +570,10 @@ struct file_operations lparcfg_fops = {
 int __init lparcfg_init(void)
 {
        struct proc_dir_entry *ent;
-       mode_t mode = S_IRUSR;
+       mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
 
        /* Allow writing if we have FW_FEATURE_SPLPAR */
-       if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
+       if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
                lparcfg_fops.write = lparcfg_write;
                mode |= S_IWUSR;
        }
@@ -598,9 +600,7 @@ int __init lparcfg_init(void)
 void __exit lparcfg_cleanup(void)
 {
        if (proc_ppc64_lparcfg) {
-               if (proc_ppc64_lparcfg->data) {
-                       kfree(proc_ppc64_lparcfg->data);
-               }
+               kfree(proc_ppc64_lparcfg->data);
                remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
        }
 }