]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: ocores: Fix -Wint-to-pointer-cast warning
authorBin Meng <bmeng.cn@gmail.com>
Sun, 12 Sep 2021 03:15:11 +0000 (11:15 +0800)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Wed, 20 Oct 2021 02:59:09 +0000 (10:59 +0800)
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>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
drivers/i2c/ocores_i2c.c

index f129ec3818c5d621255395fbe9c1c3d5be00f555..3b19ba78fa32454f1685ec3fc8f5197726625db1 100644 (file)
@@ -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' */