dm: Rename dev_addr..() functions
These support the flat device tree. We want to use the dev_read_..()
prefix for functions that support both flat tree and live tree. So rename
the existing functions to avoid confusion.
In the end we will have:
1. dev_read_addr...() - works on devices, supports flat/live tree
2. devfdt_get_addr...() - current functions, flat tree only
3. of_get_address() etc. - new functions, live tree only
All drivers will be written to use 1. That function will in turn call
either 2 or 3 depending on whether the flat or live tree is in use.
Note this involves changing some dead code - the imx_lpi2c.c file.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index eb1ba27..c8dcb82 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -174,7 +174,7 @@
{
struct altera_spi_platdata *plat = dev_get_platdata(bus);
- plat->regs = map_physmem(dev_get_addr(bus),
+ plat->regs = map_physmem(devfdt_get_addr(bus),
sizeof(struct altera_spi_regs),
MAP_NOCACHE);
diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c
index b18c733..f4b92aa 100644
--- a/drivers/spi/ath79_spi.c
+++ b/drivers/spi/ath79_spi.c
@@ -177,7 +177,7 @@
struct ath79_spi_priv *priv = dev_get_priv(bus);
fdt_addr_t addr;
- addr = dev_get_addr(bus);
+ addr = devfdt_get_addr(bus);
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 4701b79..e2f8342 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -469,7 +469,7 @@
if (ret)
return ret;
- bus_plat->regs = (struct at91_spi *)dev_get_addr(bus);
+ bus_plat->regs = (struct at91_spi *)devfdt_get_addr(bus);
ret = gpio_request_list_by_name(bus, "cs-gpios", priv->cs_gpios,
ARRAY_SIZE(priv->cs_gpios), 0);
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 65d37b0..291ef95 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -542,7 +542,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- ds->regs = dev_map_physmem(bus, sizeof(struct davinci_spi_regs));
+ ds->regs = devfdt_map_physmem(bus, sizeof(struct davinci_spi_regs));
if (!ds->regs) {
printf("%s: could not map device address\n", __func__);
return -EINVAL;
diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index 9d5e29c..5aa507b 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -134,7 +134,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->regs = (struct dw_spi *)dev_get_addr(bus);
+ plat->regs = (struct dw_spi *)devfdt_get_addr(bus);
/* Use 500KHz as a suitable default */
plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",
diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
index aa0784c..89490f7 100644
--- a/drivers/spi/exynos_spi.c
+++ b/drivers/spi/exynos_spi.c
@@ -255,7 +255,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->regs = (struct exynos_spi *)dev_get_addr(bus);
+ plat->regs = (struct exynos_spi *)devfdt_get_addr(bus);
plat->periph_id = pinmux_decode_periph_id(blob, node);
if (plat->periph_id == PERIPH_ID_NONE) {
diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
index e09985e..38caf69 100644
--- a/drivers/spi/fsl_dspi.c
+++ b/drivers/spi/fsl_dspi.c
@@ -654,7 +654,7 @@
plat->num_chipselect =
fdtdec_get_int(blob, node, "num-cs", FSL_DSPI_MAX_CHIPSELECT);
- addr = dev_get_addr(bus);
+ addr = devfdt_get_addr(bus);
if (addr == FDT_ADDR_T_NONE) {
debug("DSPI: Can't get base address or size\n");
return -ENOMEM;
diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c
index 791f3e8..0c6bd29 100644
--- a/drivers/spi/kirkwood_spi.c
+++ b/drivers/spi/kirkwood_spi.c
@@ -327,7 +327,7 @@
{
struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
- plat->spireg = (struct kwspi_registers *)dev_get_addr(bus);
+ plat->spireg = (struct kwspi_registers *)devfdt_get_addr(bus);
return 0;
}
diff --git a/drivers/spi/mvebu_a3700_spi.c b/drivers/spi/mvebu_a3700_spi.c
index ee847e4..ec49073 100644
--- a/drivers/spi/mvebu_a3700_spi.c
+++ b/drivers/spi/mvebu_a3700_spi.c
@@ -251,7 +251,7 @@
{
struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
- plat->spireg = (struct spi_reg *)dev_get_addr(bus);
+ plat->spireg = (struct spi_reg *)devfdt_get_addr(bus);
/*
* FIXME
diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 3caea15..ebbdcaf 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -633,7 +633,7 @@
struct omap2_mcspi_platform_config* data =
(struct omap2_mcspi_platform_config*)dev_get_driver_data(dev);
- priv->regs = (struct mcspi *)(dev_get_addr(dev) + data->regs_offset);
+ priv->regs = (struct mcspi *)(devfdt_get_addr(dev) + data->regs_offset);
priv->pin_dir = fdtdec_get_uint(blob, node, "ti,pindir-d0-out-d1-in",
MCSPI_PINDIR_D0_IN_D1_OUT);
priv->wordlen = SPI_DEFAULT_WORDLEN;
diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c
index ea20980..a8f0eb0 100644
--- a/drivers/spi/rk_spi.c
+++ b/drivers/spi/rk_spi.c
@@ -186,7 +186,7 @@
int node = dev_of_offset(bus);
int ret;
- plat->base = dev_get_addr(bus);
+ plat->base = devfdt_get_addr(bus);
ret = clk_get_by_index(bus, 0, &priv->clk);
if (ret < 0) {
diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index 897409c..802117e 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -103,7 +103,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->base = dev_get_addr(bus);
+ plat->base = devfdt_get_addr(bus);
plat->periph_id = clock_decode_periph_id(blob, node);
if (plat->periph_id == PERIPH_ID_NONE) {
diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c
index ecbf4c1..299e1b4 100644
--- a/drivers/spi/tegra20_sflash.c
+++ b/drivers/spi/tegra20_sflash.c
@@ -90,7 +90,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->base = dev_get_addr(bus);
+ plat->base = devfdt_get_addr(bus);
plat->periph_id = clock_decode_periph_id(blob, node);
if (plat->periph_id == PERIPH_ID_NONE) {
diff --git a/drivers/spi/tegra20_slink.c b/drivers/spi/tegra20_slink.c
index 1d99a1e..4cbde7b 100644
--- a/drivers/spi/tegra20_slink.c
+++ b/drivers/spi/tegra20_slink.c
@@ -96,7 +96,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->base = dev_get_addr(bus);
+ plat->base = devfdt_get_addr(bus);
plat->periph_id = clock_decode_periph_id(blob, node);
if (plat->periph_id == PERIPH_ID_NONE) {
diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c
index 1e094cb..6d0b5da 100644
--- a/drivers/spi/tegra210_qspi.c
+++ b/drivers/spi/tegra210_qspi.c
@@ -99,7 +99,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->base = dev_get_addr(bus);
+ plat->base = devfdt_get_addr(bus);
plat->periph_id = clock_decode_periph_id(blob, node);
if (plat->periph_id == PERIPH_ID_NONE) {
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c
index 3c4c9dd..0e8411b 100644
--- a/drivers/spi/ti_qspi.c
+++ b/drivers/spi/ti_qspi.c
@@ -584,7 +584,7 @@
return fdtdec_get_number(cell + 1, 1) + regmap_get_range(regmap, 0);
#else
fdt_addr_t addr;
- addr = dev_get_addr_index(bus, 2);
+ addr = devfdt_get_addr_index(bus, 2);
return (addr == FDT_ADDR_T_NONE) ? NULL :
map_physmem(addr, 0, MAP_NOCACHE);
#endif
@@ -597,9 +597,9 @@
int node = dev_of_offset(bus);
priv->ctrl_mod_mmap = map_syscon_chipselects(bus);
- priv->base = map_physmem(dev_get_addr(bus), sizeof(struct ti_qspi_regs),
- MAP_NOCACHE);
- priv->memory_map = map_physmem(dev_get_addr_index(bus, 1), 0,
+ priv->base = map_physmem(devfdt_get_addr(bus),
+ sizeof(struct ti_qspi_regs), MAP_NOCACHE);
+ priv->memory_map = map_physmem(devfdt_get_addr_index(bus, 1), 0,
MAP_NOCACHE);
priv->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", -1);
diff --git a/drivers/spi/zynq_spi.c b/drivers/spi/zynq_spi.c
index 2b77f1c..ed2b8cb 100644
--- a/drivers/spi/zynq_spi.c
+++ b/drivers/spi/zynq_spi.c
@@ -76,7 +76,7 @@
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
- plat->regs = (struct zynq_spi_regs *)dev_get_addr(bus);
+ plat->regs = (struct zynq_spi_regs *)devfdt_get_addr(bus);
/* FIXME: Use 250MHz as a suitable default */
plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",