softlockup: fix invalid proc_handler for softlockup_panic
[pandora-kernel.git] / arch / ppc / syslib / ppc_sys.c
index 60c724e..837183c 100644 (file)
@@ -109,9 +109,11 @@ ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr)
        int i;
        for (i = 0; i < pdev->num_resources; i++) {
                struct resource *r = &pdev->resource[i];
-               if ((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) {
+               if (((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) && 
+                       ((r->flags & PPC_SYS_IORESOURCE_FIXUPPED) != PPC_SYS_IORESOURCE_FIXUPPED)) {
                        r->start += paddr;
                        r->end += paddr;
+                       r->flags |= PPC_SYS_IORESOURCE_FIXUPPED;
                }
        }
 }
@@ -156,12 +158,13 @@ void platform_notify_map(const struct platform_notify_dev_map *map,
        while (map->bus_id != NULL) {
                idx = -1;
                s = strrchr(dev->bus_id, '.');
-               if (s != NULL)
+               if (s != NULL) {
                        idx = (int)simple_strtol(s + 1, NULL, 10);
-               else
+                       len = s - dev->bus_id;
+               } else {
                        s = dev->bus_id;
-
-               len = s - dev->bus_id;
+                       len = strlen(dev->bus_id);
+               }
 
                if (!strncmp(dev->bus_id, map->bus_id, len)) {
                        pdev = container_of(dev, struct platform_device, dev);
@@ -182,7 +185,7 @@ void platform_notify_map(const struct platform_notify_dev_map *map,
  */
 
 /*
-   Here we'll replace .name pointers with fixed-lenght strings
+   Here we'll replace .name pointers with fixed-length strings
    Hereby, this should be called *before* any func stuff triggeded.
  */
 void ppc_sys_device_initfunc(void)