diff options
author | Ley Foon Tan <ley.foon.tan@intel.com> | 2018-05-07 12:42:55 +0300 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2018-06-04 21:00:04 +0300 |
commit | 6c353674bd5219b1129e29d16484eb540e0d3925 (patch) | |
tree | c78ed73ec64a09cc34e18e7adb5b118b02e5f45b /drivers | |
parent | 809e0e398a91db7bf8b4d6259d9bfc6fbd6bce83 (diff) | |
download | u-boot-6c353674bd5219b1129e29d16484eb540e0d3925.tar.xz |
spi: cadence_qspi: Change to use devfdt_get_addr_index()
Change to use devfdt_get_addr_index() function to get fdt address.
Original code has compilation warning below:
drivers/spi/cadence_qspi.c: In function ‘cadence_spi_ofdata_to_platdata’:
drivers/spi/cadence_qspi.c:297:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
plat->regbase = (void *)data[0];
^
drivers/spi/cadence_qspi.c:298:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
plat->ahbbase = (void *)data[2];
^
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/cadence_qspi.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index b88837c0eb..91742ba5f1 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -283,18 +283,9 @@ static int cadence_spi_ofdata_to_platdata(struct udevice *bus) const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); int subnode; - u32 data[4]; - int ret; - /* 2 base addresses are needed, lets get them from the DT */ - ret = fdtdec_get_int_array(blob, node, "reg", data, ARRAY_SIZE(data)); - if (ret) { - printf("Error: Can't get base addresses (ret=%d)!\n", ret); - return -ENODEV; - } - - plat->regbase = (void *)data[0]; - plat->ahbbase = (void *)data[2]; + plat->regbase = (void *)devfdt_get_addr_index(bus, 0); + plat->ahbbase = (void *)devfdt_get_addr_index(bus, 1); plat->is_decoded_cs = fdtdec_get_bool(blob, node, "cdns,is-decoded-cs"); plat->fifo_depth = fdtdec_get_uint(blob, node, "cdns,fifo-depth", 128); plat->fifo_width = fdtdec_get_uint(blob, node, "cdns,fifo-width", 4); |