]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - drivers/watchdog/stm32mp_wdt.c
common: Drop linux/printk.h from common header
[thirdparty/u-boot.git] / drivers / watchdog / stm32mp_wdt.c
index f673fce327c6ce0591ff58eebafd6edda16d9f8c..7ebcd2552668e73222b9c060caed5ec8b4718742 100644 (file)
@@ -3,6 +3,8 @@
  * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
  */
 
+#define LOG_CATEGORY UCLASS_WDT
+
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
 #include <syscon.h>
 #include <wdt.h>
 #include <asm/io.h>
+#include <dm/device_compat.h>
 #include <linux/bitops.h>
 #include <linux/iopoll.h>
+#include <linux/printk.h>
 
 /* IWDG registers */
 #define IWDG_KR                0x00    /* Key register */
@@ -77,7 +81,7 @@ static int stm32mp_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
                                 val & (SR_PVU | SR_RVU), CONFIG_SYS_HZ);
 
        if (ret < 0) {
-               pr_err("Updating IWDG registers timeout");
+               dev_err(dev, "Updating IWDG registers timeout");
                return -ETIMEDOUT;
        }
 
@@ -90,7 +94,7 @@ static int stm32mp_wdt_probe(struct udevice *dev)
        struct clk clk;
        int ret;
 
-       debug("IWDG init\n");
+       dev_dbg(dev, "IWDG init\n");
 
        priv->base = dev_read_addr(dev);
        if (priv->base == FDT_ADDR_T_NONE)
@@ -112,7 +116,7 @@ static int stm32mp_wdt_probe(struct udevice *dev)
 
        priv->wdt_clk_rate = clk_get_rate(&clk);
 
-       debug("IWDG init done\n");
+       dev_dbg(dev, "IWDG init done\n");
 
        return 0;
 }
@@ -131,7 +135,7 @@ U_BOOT_DRIVER(stm32mp_wdt) = {
        .name = "stm32mp-wdt",
        .id = UCLASS_WDT,
        .of_match = stm32mp_wdt_match,
-       .priv_auto_alloc_size = sizeof(struct stm32mp_wdt_priv),
+       .priv_auto      = sizeof(struct stm32mp_wdt_priv),
        .probe = stm32mp_wdt_probe,
        .ops = &stm32mp_wdt_ops,
 };