]> Git Repo - J-u-boot.git/blobdiff - drivers/serial/serial_mcf.c
Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"
[J-u-boot.git] / drivers / serial / serial_mcf.c
index b599064b48807403adf6e2ab53f42d277b754f45..76143575fa982a65f6e0147e7efc32b1db8c6b84 100644 (file)
@@ -15,8 +15,8 @@
  * as serial console interface.
  */
 
-#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 +83,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 +93,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 +107,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 +119,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 +129,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 +140,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 +171,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,
This page took 0.028808 seconds and 4 git commands to generate.