@ -50,7 +50,7 @@ int regmap_init_mem_platdata(struct udevice *dev, fdt_val_t *reg, int count,
return 0 ;
return 0 ;
}
}
# else
# else
int regmap_init_mem ( struct udevice * dev , struct regmap * * mapp )
int regmap_init_mem ( ofnode node , struct regmap * * mapp )
{
{
struct regmap_range * range ;
struct regmap_range * range ;
struct regmap * map ;
struct regmap * map ;
@ -58,14 +58,13 @@ int regmap_init_mem(struct udevice *dev, struct regmap **mapp)
int addr_len , size_len , both_len ;
int addr_len , size_len , both_len ;
int len ;
int len ;
int index ;
int index ;
ofnode node = dev_ofnode ( dev ) ;
struct resource r ;
struct resource r ;
addr_len = dev _read_simple_addr_cells ( dev - > parent ) ;
addr_len = ofno de_read_simple_addr_cells( ofnode_get_parent ( node ) ) ;
size_len = dev _read_simple_size_cells ( dev - > parent ) ;
size_len = ofno de_read_simple_size_cells( ofnode_get_parent ( node ) ) ;
both_len = addr_len + size_len ;
both_len = addr_len + size_len ;
len = dev _read_size ( dev , " reg " ) ;
len = ofno de_read_size( no de, " reg " ) ;
if ( len < 0 )
if ( len < 0 )
return len ;
return len ;
len / = sizeof ( fdt32_t ) ;
len / = sizeof ( fdt32_t ) ;
@ -86,7 +85,7 @@ int regmap_init_mem(struct udevice *dev, struct regmap **mapp)
range - > size = r . end - r . start + 1 ;
range - > size = r . end - r . start + 1 ;
} else {
} else {
range - > start = fdtdec_get_addr_size_fixed ( gd - > fdt_blob ,
range - > start = fdtdec_get_addr_size_fixed ( gd - > fdt_blob ,
dev _of _offset ( dev ) , " reg " , index ,
ofno de_t o_offset( no de) , " reg " , index ,
addr_len , size_len , & sz , true ) ;
addr_len , size_len , & sz , true ) ;
range - > size = sz ;
range - > size = sz ;
}
}