struct regmap *map;
int ret;
- ret = regmap_init_mem(dev, &map);
+ ret = regmap_init_mem(dev_ofnode(dev), &map);
if (ret)
return ret;
return 0;
}
#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 *map;
int addr_len, size_len, both_len;
int len;
int index;
- ofnode node = dev_ofnode(dev);
struct resource r;
- addr_len = dev_read_simple_addr_cells(dev->parent);
- size_len = dev_read_simple_size_cells(dev->parent);
+ addr_len = ofnode_read_simple_addr_cells(ofnode_get_parent(node));
+ size_len = ofnode_read_simple_size_cells(ofnode_get_parent(node));
both_len = addr_len + size_len;
- len = dev_read_size(dev, "reg");
+ len = ofnode_read_size(node, "reg");
if (len < 0)
return len;
len /= sizeof(fdt32_t);
range->size = r.end - r.start + 1;
} else {
range->start = fdtdec_get_addr_size_fixed(gd->fdt_blob,
- dev_of_offset(dev), "reg", index,
+ ofnode_to_offset(node), "reg", index,
addr_len, size_len, &sz, true);
range->size = sz;
}
return regmap_init_mem_platdata(dev, plat->reg, ARRAY_SIZE(plat->reg),
&priv->regmap);
#else
- return regmap_init_mem(dev, &priv->regmap);
+ return regmap_init_mem(dev_ofnode(dev), &priv->regmap);
#endif
}
struct phy_meson_gxl_usb2_priv *priv = dev_get_priv(dev);
int ret;
- ret = regmap_init_mem(dev, &priv->regmap);
+ ret = regmap_init_mem(dev_ofnode(dev), &priv->regmap);
if (ret)
return ret;
struct phy_meson_gxl_usb3_priv *priv = dev_get_priv(dev);
int ret;
- ret = regmap_init_mem(dev, &priv->regmap);
+ ret = regmap_init_mem(dev_ofnode(dev), &priv->regmap);
if (ret)
return ret;
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct rk3368_sdram_params *plat = dev_get_platdata(dev);
- ret = regmap_init_mem(dev, &plat->map);
+ ret = regmap_init_mem(dev_ofnode(dev), &plat->map);
if (ret)
return ret;
#endif
printf("%s: Cannot read rockchip,sdram-params\n", __func__);
return -EINVAL;
}
- ret = regmap_init_mem(dev, ¶ms->map);
+ ret = regmap_init_mem(dev_ofnode(dev), ¶ms->map);
if (ret)
return ret;
#endif
printf("%s: Cannot read rockchip,sdram-params\n", __func__);
return -EINVAL;
}
- ret = regmap_init_mem(dev, ¶ms->map);
+ ret = regmap_init_mem(dev_ofnode(dev), ¶ms->map);
if (ret)
return ret;
#endif
priv->is_veyron = !fdt_node_check_compatible(blob, 0, "google,veyron");
#endif
- ret = regmap_init_mem(dev, ¶ms->map);
+ ret = regmap_init_mem(dev_ofnode(dev), ¶ms->map);
if (ret)
return ret;
#endif
__func__, ret);
return ret;
}
- ret = regmap_init_mem(dev, &plat->map);
+ ret = regmap_init_mem(dev_ofnode(dev), &plat->map);
if (ret)
printf("%s: regmap failed %d\n", __func__, ret);
debug("STM32MP1 DDR probe\n");
priv->dev = dev;
- ret = regmap_init_mem(dev, &map);
+ ret = regmap_init_mem(dev_ofnode(dev), &map);
if (ret)
return ret;
{
struct meson_reset_priv *priv = dev_get_priv(dev);
- return regmap_init_mem(dev, &priv->regmap);
+ return regmap_init_mem(dev_ofnode(dev), &priv->regmap);
}
U_BOOT_DRIVER(meson_reset) = {
*
* Use regmap_uninit() to free it.
*
- * @dev: Device that uses this map
+ * @node: Device node that uses this map
* @mapp: Returns allocated map
*/
-int regmap_init_mem(struct udevice *dev, struct regmap **mapp);
+int regmap_init_mem(ofnode node, struct regmap **mapp);
/**
* regmap_init_mem_platdata() - Set up a new memory register map for of-platdata