dt-bindings: pinctrl: k3: Synchronize with v5.14 kernel
[platform/kernel/u-boot.git] / drivers / serial / serial_mcf.c
index b599064..bb2afd0 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <asm/global_data.h>
 #include <dm/platform_data/serial_coldfire.h>
 #include <serial.h>
 #include <linux/compiler.h>
@@ -83,9 +84,9 @@ static void mcf_serial_setbrg_common(uart_t *uart, int baudrate)
 
 static int coldfire_serial_probe(struct udevice *dev)
 {
-       struct coldfire_serial_platdata *plat = dev->platdata;
+       struct coldfire_serial_plat *plat = dev_get_plat(dev);
 
-       plat->port = dev->seq;
+       plat->port = dev_seq(dev);
 
        return mcf_serial_init_common((uart_t *)plat->base,
                                                plat->port, plat->baudrate);
@@ -93,7 +94,7 @@ static int coldfire_serial_probe(struct udevice *dev)
 
 static int coldfire_serial_putc(struct udevice *dev, const char ch)
 {
-       struct coldfire_serial_platdata *plat = dev->platdata;
+       struct coldfire_serial_plat *plat = dev_get_plat(dev);
        uart_t *uart = (uart_t *)plat->base;
 
        /* Wait for last character to go. */
@@ -107,7 +108,7 @@ static int coldfire_serial_putc(struct udevice *dev, const char ch)
 
 static int coldfire_serial_getc(struct udevice *dev)
 {
-       struct coldfire_serial_platdata *plat = dev->platdata;
+       struct coldfire_serial_plat *plat = dev_get_plat(dev);
        uart_t *uart = (uart_t *)(plat->base);
 
        /* Wait for a character to arrive. */
@@ -119,7 +120,7 @@ static int coldfire_serial_getc(struct udevice *dev)
 
 int coldfire_serial_setbrg(struct udevice *dev, int baudrate)
 {
-       struct coldfire_serial_platdata *plat = dev->platdata;
+       struct coldfire_serial_plat *plat = dev_get_plat(dev);
        uart_t *uart = (uart_t *)(plat->base);
 
        mcf_serial_setbrg_common(uart, baudrate);
@@ -129,7 +130,7 @@ int coldfire_serial_setbrg(struct udevice *dev, int baudrate)
 
 static int coldfire_serial_pending(struct udevice *dev, bool input)
 {
-       struct coldfire_serial_platdata *plat = dev->platdata;
+       struct coldfire_serial_plat *plat = dev_get_plat(dev);
        uart_t *uart = (uart_t *)(plat->base);
 
        if (input)
@@ -140,12 +141,12 @@ static int coldfire_serial_pending(struct udevice *dev, bool input)
        return 0;
 }
 
-static int coldfire_ofdata_to_platdata(struct udevice *dev)
+static int coldfire_of_to_plat(struct udevice *dev)
 {
-       struct coldfire_serial_platdata *plat = dev_get_platdata(dev);
+       struct coldfire_serial_plat *plat = dev_get_plat(dev);
        fdt_addr_t addr_base;
 
-       addr_base = devfdt_get_addr(dev);
+       addr_base = dev_read_addr(dev);
        if (addr_base == FDT_ADDR_T_NONE)
                return -ENODEV;
 
@@ -171,8 +172,8 @@ U_BOOT_DRIVER(serial_coldfire) = {
        .name = "serial_coldfire",
        .id = UCLASS_SERIAL,
        .of_match = coldfire_serial_ids,
-       .ofdata_to_platdata = coldfire_ofdata_to_platdata,
-       .platdata_auto_alloc_size = sizeof(struct coldfire_serial_platdata),
+       .of_to_plat = coldfire_of_to_plat,
+       .plat_auto      = sizeof(struct coldfire_serial_plat),
        .probe = coldfire_serial_probe,
        .ops = &coldfire_serial_ops,
        .flags = DM_FLAG_PRE_RELOC,