aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/syslib/ppc_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/syslib/ppc_sys.c')
-rw-r--r--arch/ppc/syslib/ppc_sys.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/ppc/syslib/ppc_sys.c b/arch/ppc/syslib/ppc_sys.c
index 60c724e11584..2d48018b71d9 100644
--- a/arch/ppc/syslib/ppc_sys.c
+++ b/arch/ppc/syslib/ppc_sys.c
@@ -109,9 +109,11 @@ ppc_sys_fixup_mem_resource(struct platform_device *pdev, phys_addr_t paddr)
109 int i; 109 int i;
110 for (i = 0; i < pdev->num_resources; i++) { 110 for (i = 0; i < pdev->num_resources; i++) {
111 struct resource *r = &pdev->resource[i]; 111 struct resource *r = &pdev->resource[i];
112 if ((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) { 112 if (((r->flags & IORESOURCE_MEM) == IORESOURCE_MEM) &&
113 ((r->flags & PPC_SYS_IORESOURCE_FIXUPPED) != PPC_SYS_IORESOURCE_FIXUPPED)) {
113 r->start += paddr; 114 r->start += paddr;
114 r->end += paddr; 115 r->end += paddr;
116 r->flags |= PPC_SYS_IORESOURCE_FIXUPPED;
115 } 117 }
116 } 118 }
117} 119}
@@ -156,12 +158,13 @@ void platform_notify_map(const struct platform_notify_dev_map *map,
156 while (map->bus_id != NULL) { 158 while (map->bus_id != NULL) {
157 idx = -1; 159 idx = -1;
158 s = strrchr(dev->bus_id, '.'); 160 s = strrchr(dev->bus_id, '.');
159 if (s != NULL) 161 if (s != NULL) {
160 idx = (int)simple_strtol(s + 1, NULL, 10); 162 idx = (int)simple_strtol(s + 1, NULL, 10);
161 else 163 len = s - dev->bus_id;
164 } else {
162 s = dev->bus_id; 165 s = dev->bus_id;
163 166 len = strlen(dev->bus_id);
164 len = s - dev->bus_id; 167 }
165 168
166 if (!strncmp(dev->bus_id, map->bus_id, len)) { 169 if (!strncmp(dev->bus_id, map->bus_id, len)) {
167 pdev = container_of(dev, struct platform_device, dev); 170 pdev = container_of(dev, struct platform_device, dev);