diff options
-rw-r--r-- | arch/sparc64/mm/init.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 45a70d677d8b..9d2b0da590af 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -102,8 +102,6 @@ static void __init read_obp_memory(const char *property, | |||
102 | prom_halt(); | 102 | prom_halt(); |
103 | } | 103 | } |
104 | 104 | ||
105 | *num_ents = ents; | ||
106 | |||
107 | /* Sanitize what we got from the firmware, by page aligning | 105 | /* Sanitize what we got from the firmware, by page aligning |
108 | * everything. | 106 | * everything. |
109 | */ | 107 | */ |
@@ -125,6 +123,25 @@ static void __init read_obp_memory(const char *property, | |||
125 | regs[i].phys_addr = base; | 123 | regs[i].phys_addr = base; |
126 | regs[i].reg_size = size; | 124 | regs[i].reg_size = size; |
127 | } | 125 | } |
126 | |||
127 | for (i = 0; i < ents; i++) { | ||
128 | if (regs[i].reg_size == 0UL) { | ||
129 | int j; | ||
130 | |||
131 | for (j = i; j < ents - 1; j++) { | ||
132 | regs[j].phys_addr = | ||
133 | regs[j+1].phys_addr; | ||
134 | regs[j].reg_size = | ||
135 | regs[j+1].reg_size; | ||
136 | } | ||
137 | |||
138 | ents--; | ||
139 | i--; | ||
140 | } | ||
141 | } | ||
142 | |||
143 | *num_ents = ents; | ||
144 | |||
128 | sort(regs, ents, sizeof(struct linux_prom64_registers), | 145 | sort(regs, ents, sizeof(struct linux_prom64_registers), |
129 | cmp_p64, NULL); | 146 | cmp_p64, NULL); |
130 | } | 147 | } |