]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: s5p: Use dev_read_addr_ptr() to get base address
authorSam Protsenko <semen.protsenko@linaro.org>
Tue, 7 Nov 2023 20:13:49 +0000 (14:13 -0600)
committerMinkyu Kang <mk7.kang@samsung.com>
Mon, 27 Nov 2023 09:04:11 +0000 (18:04 +0900)
As the address read from device tree is being cast to a pointer, it's
better to use dev_read_addr_ptr() API for getting that address. The more
detailed explanation can be found in commit a12a73b66476 ("drivers: use
dev_read_addr_ptr when cast to pointer").

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/serial/serial_s5p.c

index c24d9bca84c9f136d15ce63ad31aec23a472fbcd..7d04dcff54fcb874266e94e9103534a068210383 100644 (file)
@@ -221,13 +221,11 @@ static int s5p_serial_of_to_plat(struct udevice *dev)
 {
        struct s5p_serial_plat *plat = dev_get_plat(dev);
        const ulong port_type = dev_get_driver_data(dev);
-       fdt_addr_t addr;
 
-       addr = dev_read_addr(dev);
-       if (addr == FDT_ADDR_T_NONE)
+       plat->reg = dev_read_addr_ptr(dev);
+       if (!plat->reg)
                return -EINVAL;
 
-       plat->reg = (struct s5p_uart *)addr;
        plat->reg_width = dev_read_u32_default(dev, "reg-io-width", 1);
        plat->port_id = dev_read_u8_default(dev, "id", dev_seq(dev));