dm: treewide: Rename auto_alloc_size members to be shorter
[platform/kernel/u-boot.git] / drivers / serial / serial_sh.c
index acfcc29..4e37ab0 100644 (file)
@@ -15,6 +15,7 @@
 #include <serial.h>
 #include <linux/compiler.h>
 #include <dm/platform_data/serial_sh.h>
+#include <linux/delay.h>
 #include "serial_sh.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -115,7 +116,10 @@ static int serial_getc_check(struct uart_port *port)
                handle_error(port);
        if (sci_in(port, SCLSR) & SCxSR_ORER(port))
                handle_error(port);
-       return status & (SCIF_DR | SCxSR_RDxF(port));
+       status &= (SCIF_DR | SCxSR_RDxF(port));
+       if (status)
+               return status;
+       return scif_rxfill(port);
 }
 
 static int sh_serial_getc_generic(struct uart_port *port)
@@ -210,7 +214,7 @@ static int sh_serial_ofdata_to_platdata(struct udevice *dev)
        fdt_addr_t addr;
        int ret;
 
-       addr = devfdt_get_addr(dev);
+       addr = dev_read_addr(dev);
        if (!addr)
                return -EINVAL;
 
@@ -236,13 +240,13 @@ U_BOOT_DRIVER(serial_sh) = {
        .id     = UCLASS_SERIAL,
        .of_match = of_match_ptr(sh_serial_id),
        .ofdata_to_platdata = of_match_ptr(sh_serial_ofdata_to_platdata),
-       .platdata_auto_alloc_size = sizeof(struct sh_serial_platdata),
+       .platdata_auto  = sizeof(struct sh_serial_platdata),
        .probe  = sh_serial_probe,
        .ops    = &sh_serial_ops,
 #if !CONFIG_IS_ENABLED(OF_CONTROL)
        .flags  = DM_FLAG_PRE_RELOC,
 #endif
-       .priv_auto_alloc_size = sizeof(struct uart_port),
+       .priv_auto      = sizeof(struct uart_port),
 };
 
 #else /* CONFIG_DM_SERIAL */