summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJohan Jonker <jbx6244@gmail.com>2023-03-13 01:32:04 +0100
committerKever Yang <kever.yang@rock-chips.com>2023-05-06 17:28:18 +0800
commita12a73b66476c48dfe5afd2c3711153d09feda6c (patch)
tree3a73c36e66587675ac707d82a8852653d4eaec65 /drivers/mtd
parente5822ecba2d73e64ca55c26fc4762d9e80b1f1b5 (diff)
downloadu-boot-a12a73b66476c48dfe5afd2c3711153d09feda6c.tar.gz
u-boot-a12a73b66476c48dfe5afd2c3711153d09feda6c.tar.bz2
u-boot-a12a73b66476c48dfe5afd2c3711153d09feda6c.zip
drivers: use dev_read_addr_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_ptr instead of the dev_read_addr 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 <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/arasan_nfc.c2
-rw-r--r--drivers/mtd/nand/raw/cortina_nand.c2
-rw-r--r--drivers/mtd/nand/raw/mxic_nand.c2
-rw-r--r--drivers/mtd/nand/raw/tegra_nand.c2
-rw-r--r--drivers/mtd/nand/raw/zynq_nand.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/raw/arasan_nfc.c b/drivers/mtd/nand/raw/arasan_nfc.c
index 99e2681c14..587941290d 100644
--- a/drivers/mtd/nand/raw/arasan_nfc.c
+++ b/drivers/mtd/nand/raw/arasan_nfc.c
@@ -1233,7 +1233,7 @@ static int arasan_probe(struct udevice *dev)
ofnode child;
int err = -1;
- info->reg = (struct nand_regs *)dev_read_addr(dev);
+ info->reg = dev_read_addr_ptr(dev);
mtd = nand_to_mtd(nand_chip);
nand_set_controller_data(nand_chip, &arasan->nand_ctrl);
diff --git a/drivers/mtd/nand/raw/cortina_nand.c b/drivers/mtd/nand/raw/cortina_nand.c
index 8de35731a5..b7be6602f7 100644
--- a/drivers/mtd/nand/raw/cortina_nand.c
+++ b/drivers/mtd/nand/raw/cortina_nand.c
@@ -1174,7 +1174,7 @@ 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->reg = dev_read_addr_ptr(dev);
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);
diff --git a/drivers/mtd/nand/raw/mxic_nand.c b/drivers/mtd/nand/raw/mxic_nand.c
index e54df4615e..6abdc24bd3 100644
--- a/drivers/mtd/nand/raw/mxic_nand.c
+++ b/drivers/mtd/nand/raw/mxic_nand.c
@@ -538,7 +538,7 @@ static int mxic_nfc_probe(struct udevice *dev)
ofnode child;
int err;
- nfc->regs = (void *)dev_read_addr(dev);
+ nfc->regs = dev_read_addr_ptr(dev);
nfc->send_clk = devm_clk_get(dev, "send");
if (IS_ERR(nfc->send_clk))
diff --git a/drivers/mtd/nand/raw/tegra_nand.c b/drivers/mtd/nand/raw/tegra_nand.c
index d2801d48a3..139d978a49 100644
--- a/drivers/mtd/nand/raw/tegra_nand.c
+++ b/drivers/mtd/nand/raw/tegra_nand.c
@@ -906,7 +906,7 @@ static int fdt_decode_nand(struct udevice *dev, struct fdt_nand *config)
{
int err;
- config->reg = (struct nand_ctlr *)dev_read_addr(dev);
+ config->reg = dev_read_addr_ptr(dev);
config->enabled = dev_read_enabled(dev);
config->width = dev_read_u32_default(dev, "nvidia,nand-width", 8);
err = gpio_request_by_name(dev, "nvidia,wp-gpios", 0, &config->wp_gpio,
diff --git a/drivers/mtd/nand/raw/zynq_nand.c b/drivers/mtd/nand/raw/zynq_nand.c
index 14cb2ba704..9e3ee7412d 100644
--- a/drivers/mtd/nand/raw/zynq_nand.c
+++ b/drivers/mtd/nand/raw/zynq_nand.c
@@ -1085,7 +1085,7 @@ static int zynq_nand_probe(struct udevice *dev)
int ondie_ecc_enabled = 0;
int is_16bit_bw;
- smc->reg = (struct zynq_nand_smc_regs *)dev_read_addr(dev);
+ smc->reg = dev_read_addr_ptr(dev);
of_nand = dev_read_subnode(dev, "nand-controller@0,0");
if (!ofnode_valid(of_nand)) {
of_nand = dev_read_subnode(dev, "flash@e1000000");