]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
serial: s5p: Use livetree API to get "id" property
authorSam Protsenko <semen.protsenko@linaro.org>
Tue, 7 Nov 2023 19:05:59 +0000 (13:05 -0600)
committerMinkyu Kang <mk7.kang@samsung.com>
Thu, 23 Nov 2023 06:24:18 +0000 (15:24 +0900)
Use dev_read_u8_default() instead of fdtdec_get_int() to read the "id"
property from device tree, as suggested in [1]. dev_* API is already
used in this driver, so there is no reason to stick to fdtdec_* API.
This also fixes checkpatch warning:

    WARNING: Use the livetree API (dev_read_...)

[1] doc/develop/driver-model/livetree.rst

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 1772155356760d0239ec3e21c6ed93d2c550ff0e..c57bdd059ea6998848c85cb0a9a2bca145868e1b 100644 (file)
@@ -20,8 +20,6 @@
 #include <serial.h>
 #include <clk.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
        PORT_S5P = 0,
        PORT_S5L
@@ -220,8 +218,7 @@ static int s5p_serial_of_to_plat(struct udevice *dev)
 
        plat->reg = (struct s5p_uart *)addr;
        plat->reg_width = dev_read_u32_default(dev, "reg-io-width", 1);
-       plat->port_id = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-                                       "id", dev_seq(dev));
+       plat->port_id = dev_read_u8_default(dev, "id", dev_seq(dev));
 
        if (port_type == PORT_S5L) {
                plat->rx_fifo_count_shift = S5L_RX_FIFO_COUNT_SHIFT;