diff options
author | Matthias Schiffer <matthias.schiffer@ew.tq-group.com> | 2023-09-27 15:33:34 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-10-13 14:01:42 -0600 |
commit | 5fecea171de3b66e9e3a199c588bf12c6b1d3084 (patch) | |
tree | 18496a3648b391f6d3dd9cf81bacb6f765260aa5 /drivers/soc | |
parent | 7f18fb8a272893eb32ce88cb780d51b4390b1899 (diff) | |
download | u-boot-5fecea171de3b66e9e3a199c588bf12c6b1d3084.tar.gz u-boot-5fecea171de3b66e9e3a199c588bf12c6b1d3084.tar.bz2 u-boot-5fecea171de3b66e9e3a199c588bf12c6b1d3084.zip |
treewide: use dev_read_addr_*_ptr() where appropriate
A follow-up to commit 842fb5de424e
("drivers: use devfdt_get_addr_size_index_ptr when cast to pointer")
and commit 320a1938b6f7
("drivers: use devfdt_get_addr_index_ptr when cast to pointer").
In addition to using the *_ptr variants of these functions where the
address is cast to a pointer, this also changes devfdt_get_addr_*() to
dev_read_addr_*() in a few places. Some variable and field types are
changed from fdt_addr_t or phys_addr_t to void* where the cast was
happening later.
This patch fixes a number of compile warnings when building a 32bit
U-Boot with CONFIG_PHYS_64BIT=y. In some places, it also fixes error
handling where the return value of dev_read_addr() etc. was checked for
NULL instead of FDT_ADDR_T_NONE.
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/ti/k3-navss-ringacc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/soc/ti/k3-navss-ringacc.c b/drivers/soc/ti/k3-navss-ringacc.c index 9881bffc8e..e02889649b 100644 --- a/drivers/soc/ti/k3-navss-ringacc.c +++ b/drivers/soc/ti/k3-navss-ringacc.c @@ -987,10 +987,10 @@ static int k3_nav_ringacc_init(struct udevice *dev, struct k3_nav_ringacc *ringa if (!base_cfg) return -EINVAL; - base_rt = (uint32_t *)devfdt_get_addr_name(dev, "rt"); + base_rt = dev_read_addr_name_ptr(dev, "rt"); pr_debug("rt %p\n", base_rt); - if (IS_ERR(base_rt)) - return PTR_ERR(base_rt); + if (!base_rt) + return -EINVAL; ringacc->rings = devm_kzalloc(dev, sizeof(*ringacc->rings) * @@ -1045,9 +1045,9 @@ struct k3_nav_ringacc *k3_ringacc_dmarings_init(struct udevice *dev, ringacc->tisci = data->tisci; ringacc->tisci_dev_id = data->tisci_dev_id; - base_rt = (uint32_t *)devfdt_get_addr_name(dev, "ringrt"); - if (IS_ERR(base_rt)) - return base_rt; + base_rt = dev_read_addr_name_ptr(dev, "ringrt"); + if (!base_rt) + return ERR_PTR(-EINVAL); ringacc->rings = devm_kzalloc(dev, sizeof(*ringacc->rings) * |