]> git.baikalelectronics.ru Git - uboot.git/commitdiff
serial: altera_uart: convert to livetree
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Thu, 9 May 2019 20:11:58 +0000 (22:11 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 10 May 2019 20:48:11 +0000 (22:48 +0200)
Convert 'altera_uart_ofdata_to_platdata' to use 'dev_read_u32_default'
instead of 'fdtdec_get_int' and get rid of DECLARE_GLOBAL_DATA_PTR.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
drivers/serial/altera_uart.c

index 67d47199aa4c8d1dd6060f7ff2a663aa0c038eba..436cf2331df952cc92e0ca0e9486ab96f0401f42 100644 (file)
@@ -10,8 +10,6 @@
 #include <serial.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* status register */
 #define ALTERA_UART_TMT                BIT(5)  /* tx empty */
 #define ALTERA_UART_TRDY       BIT(6)  /* tx ready */
@@ -91,8 +89,7 @@ static int altera_uart_ofdata_to_platdata(struct udevice *dev)
        plat->regs = map_physmem(devfdt_get_addr(dev),
                                 sizeof(struct altera_uart_regs),
                                 MAP_NOCACHE);
-       plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-               "clock-frequency", 0);
+       plat->uartclk = dev_read_u32_default(dev, "clock-frequency", 0);
 
        return 0;
 }