int addr_len, size_len, both_len;
int parent;
int len;
+ int index;
parent = dev_of_offset(dev->parent);
addr_len = fdt_address_cells(blob, parent);
if (!map)
return -ENOMEM;
- map->base = fdtdec_get_number(cell, addr_len);
-
- for (range = map->range; count > 0;
- count--, cell += both_len, range++) {
- range->start = fdtdec_get_number(cell, addr_len);
- range->size = fdtdec_get_number(cell + addr_len, size_len);
+ for (range = map->range, index = 0; count > 0;
+ count--, cell += both_len, range++, index++) {
+ fdt_size_t sz;
+ range->start = fdtdec_get_addr_size_fixed(blob, dev->of_offset,
+ "reg", index, addr_len, size_len, &sz, true);
+ range->size = sz;
}
+ map->base = map->range[0].start;
*mapp = map;