diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2021-09-12 11:15:09 +0800 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2021-10-20 10:59:09 +0800 |
commit | 2edb02ead760630a6495d4e583e2364d10cb850a (patch) | |
tree | fda4b7c5d57503abbcdf1665cb7c82a4000bebea | |
parent | 2fb91a2ea74e87d5e26e95f602c9f8e3951a35cf (diff) | |
download | u-boot-2edb02ead760630a6495d4e583e2364d10cb850a.zip u-boot-2edb02ead760630a6495d4e583e2364d10cb850a.tar.gz u-boot-2edb02ead760630a6495d4e583e2364d10cb850a.tar.bz2 |
clk: sifive: Fix -Wint-to-pointer-cast warning
dev_read_addr() returns a value of type fdt_addr_t which is a 64-bit
address and pd->va is a pointer. In a 32-bit build, this causes the
following warning seen when building sifive-prci.c:
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Change to use dev_read_addr_ptr().
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
-rw-r--r-- | drivers/clk/sifive/sifive-prci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index cd1acb9..52ae268 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -653,9 +653,9 @@ static int sifive_prci_probe(struct udevice *dev) struct prci_clk_desc *data = (struct prci_clk_desc *)dev_get_driver_data(dev); - pd->va = (void *)dev_read_addr(dev); - if (IS_ERR(pd->va)) - return PTR_ERR(pd->va); + pd->va = dev_read_addr_ptr(dev); + if (!pd->va) + return -EINVAL; err = clk_get_by_index(dev, 0, &pd->parent_hfclk); if (err) |