]> git.baikalelectronics.ru Git - uboot.git/commitdiff
pinctrl: Fix build warning with ARM64
authorLokesh Vutla <lokeshvutla@ti.com>
Thu, 16 Aug 2018 13:11:49 +0000 (18:41 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 11 Sep 2018 00:48:20 +0000 (20:48 -0400)
Following build warning appears when pinctrl-single is built for ARM64:

In file included from drivers/pinctrl/pinctrl-single.c:10:0:
drivers/pinctrl/pinctrl-single.c: In function ‘single_configure_pins’:
./arch/arm/include/asm/io.h:43:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define __arch_getw(a)   (*(volatile unsigned short *)(a))

Fix this by using phys_addr_t for variable reg instead of u32

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
drivers/pinctrl/pinctrl-single.c

index 296eb63cc498bdcc2fb284aa0d1e6ec87a25607e..d80c6eda70e44ca198df25f72ff9716d2beb08a1 100644 (file)
@@ -43,13 +43,13 @@ static int single_configure_pins(struct udevice *dev,
 {
        struct single_pdata *pdata = dev->platdata;
        int count = size / sizeof(struct single_fdt_pin_cfg);
-       int n, reg;
+       phys_addr_t n, reg;
        u32 val;
 
        for (n = 0; n < count; n++, pins++) {
                reg = fdt32_to_cpu(pins->reg);
                if ((reg < 0) || (reg > pdata->offset)) {
-                       dev_dbg(dev, "  invalid register offset 0x%08x\n", reg);
+                       dev_dbg(dev, "  invalid register offset 0x%pa\n", &reg);
                        continue;
                }
                reg += pdata->base;
@@ -66,7 +66,7 @@ static int single_configure_pins(struct udevice *dev,
                                 pdata->width);
                        continue;
                }
-               dev_dbg(dev, "  reg/val 0x%08x/0x%08x\n",reg, val);
+               dev_dbg(dev, "  reg/val 0x%pa/0x%08x\n", &reg, val);
        }
        return 0;
 }