]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: ns16550: Correct the base address type
authorBin Meng <bmeng.cn@gmail.com>
Wed, 3 Feb 2021 13:22:40 +0000 (21:22 +0800)
committerSimon Glass <sjg@chromium.org>
Thu, 4 Mar 2021 02:17:25 +0000 (19:17 -0700)
Currently ns16550_serial_assign_base() treats the argument 'base'
with type `ulong`. This is incorrect because the base address was
obtained from device tree with type `fdt_addr_t` that can represent
a physical address larger than 32-bit in a 32-bit system.

Fixes: 9e6ce62190b7 ("serial: ns16550: Fix ordering of getting base address")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/ns16550.c

index b9e99babebb12a1ca421a4db7cd219729da61d75..1377c9a0e11dc3c0a7f25e7389e3ba0135fbf7d5 100644 (file)
@@ -483,7 +483,7 @@ static int ns16550_serial_getinfo(struct udevice *dev,
        return 0;
 }
 
-static int ns16550_serial_assign_base(struct ns16550_plat *plat, ulong base)
+static int ns16550_serial_assign_base(struct ns16550_plat *plat, fdt_addr_t base)
 {
        if (base == FDT_ADDR_T_NONE)
                return -EINVAL;