dm: treewide: Rename auto_alloc_size members to be shorter
[platform/kernel/u-boot.git] / drivers / serial / serial_pic32.c
index b0e01aa..5d1dbe7 100644 (file)
@@ -1,14 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (c) 2015 Paul Thacker <paul.thacker@microchip.com>
  *
- * SPDX-License-Identifier:    GPL-2.0+
- *
  */
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <malloc.h>
 #include <serial.h>
 #include <wait_bit.h>
+#include <linux/bitops.h>
 #include <mach/pic32.h>
 #include <dt-bindings/clock/microchip,clock.h>
 
@@ -51,8 +52,8 @@ static int pic32_serial_init(void __iomem *base, ulong clk, u32 baudrate)
        u32 div = DIV_ROUND_CLOSEST(clk, baudrate * 16);
 
        /* wait for TX FIFO to empty */
-       wait_for_bit(__func__, base + U_STA, UART_TX_EMPTY,
-                    true, CONFIG_SYS_HZ, false);
+       wait_for_bit_le32(base + U_STA, UART_TX_EMPTY,
+                         true, CONFIG_SYS_HZ, false);
 
        /* send break */
        writel(UART_TX_BRK, base + U_STASET);
@@ -177,8 +178,7 @@ U_BOOT_DRIVER(pic32_serial) = {
        .of_match       = pic32_uart_ids,
        .probe          = pic32_uart_probe,
        .ops            = &pic32_uart_ops,
-       .flags          = DM_FLAG_PRE_RELOC,
-       .priv_auto_alloc_size = sizeof(struct pic32_uart_priv),
+       .priv_auto      = sizeof(struct pic32_uart_priv),
 };
 
 #ifdef CONFIG_DEBUG_UART_PIC32