powerpc: Make "intspec" pointers in irq_host->xlate() const
[safe/jmp/linux-2.6] / arch / powerpc / platforms / pseries / reconfig.c
index c591a25..a2305d2 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/machdep.h>
 #include <asm/uaccess.h>
 #include <asm/pSeries_reconfig.h>
+#include <asm/mmu.h>
 
 
 
@@ -95,7 +96,7 @@ static struct device_node *derive_parent(const char *path)
        return parent;
 }
 
-static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain);
+BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain);
 
 int pSeries_reconfig_notifier_register(struct notifier_block *nb)
 {
@@ -183,7 +184,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np)
 }
 
 /*
- * /proc/ppc64/ofdt - yucky binary interface for adding and removing
+ * /proc/powerpc/ofdt - yucky binary interface for adding and removing
  * OF device nodes.  Should be deprecated as soon as we get an
  * in-kernel wrapper for the RTAS ibm,configure-connector call.
  */
@@ -439,9 +440,15 @@ static int do_update_property(char *buf, size_t bufsize)
        if (!newprop)
                return -ENOMEM;
 
+       if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))
+               slb_set_size(*(int *)value);
+
        oldprop = of_find_property(np, name,NULL);
-       if (!oldprop)
+       if (!oldprop) {
+               if (strlen(name))
+                       return prom_add_property(np, newprop);
                return -ENODEV;
+       }
 
        rc = prom_update_property(np, newprop, oldprop);
        if (rc)
@@ -468,9 +475,13 @@ static int do_update_property(char *buf, size_t bufsize)
 
                rc = blocking_notifier_call_chain(&pSeries_reconfig_chain,
                                                  action, value);
+               if (rc == NOTIFY_BAD) {
+                       rc = prom_update_property(np, oldprop, newprop);
+                       return -ENOMEM;
+               }
        }
 
-       return rc;
+       return 0;
 }
 
 /**
@@ -532,7 +543,7 @@ static const struct file_operations ofdt_fops = {
        .write = ofdt_write
 };
 
-/* create /proc/ppc64/ofdt write-only by root */
+/* create /proc/powerpc/ofdt write-only by root */
 static int proc_ppc64_create_ofdt(void)
 {
        struct proc_dir_entry *ent;
@@ -540,7 +551,7 @@ static int proc_ppc64_create_ofdt(void)
        if (!machine_is(pseries))
                return 0;
 
-       ent = proc_create("ppc64/ofdt", S_IWUSR, NULL, &ofdt_fops);
+       ent = proc_create("powerpc/ofdt", S_IWUSR, NULL, &ofdt_fops);
        if (ent)
                ent->size = 0;