diff mbox series

[4/9] i2c: ocores: Fix -Wint-to-pointer-cast warning

Message ID 20210912031516.24885-4-bmeng.cn@gmail.com
State Accepted
Commit 7e22c85918e68e6df50d01d08585f88fbbaf3456
Delegated to: Andes
Headers show
Series [1/9] cache: sifive: Fix -Wint-to-pointer-cast warning | expand

Commit Message

Bin Meng Sept. 12, 2021, 3:15 a.m. UTC
The following warning is seen in ocores_i2c.c in a 32-bit build:

  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>
---

 drivers/i2c/ocores_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leo Liang Sept. 15, 2021, 4:39 a.m. UTC | #1
On Sun, Sep 12, 2021 at 11:15:11AM +0800, Bin Meng wrote:
> The following warning is seen in ocores_i2c.c in a 32-bit build:
> 
>   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>
> ---
> 
>  drivers/i2c/ocores_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
diff mbox series

Patch

diff --git a/drivers/i2c/ocores_i2c.c b/drivers/i2c/ocores_i2c.c
index f129ec3818..3b19ba78fa 100644
--- a/drivers/i2c/ocores_i2c.c
+++ b/drivers/i2c/ocores_i2c.c
@@ -516,7 +516,7 @@  static int ocores_i2c_probe(struct udevice *dev)
 	u32 clock_frequency_khz;
 	int ret;
 
-	bus->base = (void __iomem *)devfdt_get_addr(dev);
+	bus->base = dev_read_addr_ptr(dev);
 
 	if (dev_read_u32(dev, "reg-shift", &bus->reg_shift)) {
 		/* no 'reg-shift', check for deprecated 'regstep' */