summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJohan Jonker <[email protected]>2023-03-13 01:31:49 +0100
committerKever Yang <[email protected]>2023-05-06 17:28:18 +0800
commite5822ecba2d73e64ca55c26fc4762d9e80b1f1b5 (patch)
treeed5afa03d8d1d2f8b27ee44a8d19c215f7017378 /drivers/mtd
parent8fa64bd1715d38f079e1369d282ac06c879be083 (diff)
drivers: use dev_read_addr_index_ptr when cast to pointer
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so use dev_read_addr_index_ptr instead of the dev_read_addr_index function in the various files in the drivers directory that cast to a pointer. As we are there also streamline the error response to -EINVAL on return. Signed-off-by: Johan Jonker <[email protected]> Reviewed-by: Michael Trimarchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/cortina_nand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/cortina_nand.c b/drivers/mtd/nand/raw/cortina_nand.c
index 88798f233ea..8de35731a53 100644
--- a/drivers/mtd/nand/raw/cortina_nand.c
+++ b/drivers/mtd/nand/raw/cortina_nand.c
@@ -1175,8 +1175,8 @@ static int fdt_decode_nand(struct udevice *dev, struct nand_drv *info)
int ecc_strength;
info->reg = (struct nand_ctlr *)dev_read_addr(dev);
- info->dma_glb = (struct dma_global *)dev_read_addr_index(dev, 1);
- info->dma_nand = (struct dma_ssp *)dev_read_addr_index(dev, 2);
+ info->dma_glb = dev_read_addr_index_ptr(dev, 1);
+ info->dma_nand = dev_read_addr_index_ptr(dev, 2);
info->config.enabled = dev_read_enabled(dev);
ecc_strength = dev_read_u32_default(dev, "nand-ecc-strength", 16);
info->flash_base =