]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: define LOG_CATEGORY for generic and ccf clocks
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 19 Nov 2021 14:12:07 +0000 (15:12 +0100)
committerSean Anderson <seanga2@gmail.com>
Wed, 15 Dec 2021 17:16:16 +0000 (12:16 -0500)
Define LOG_CATEGORY to allow filtering with log command
for generic clock and CCF clocks.

This patch also change existing printf, debug and pr_ macro
to log_ or dev_ macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
drivers/clk/clk-composite.c
drivers/clk/clk-divider.c
drivers/clk/clk-fixed-factor.c
drivers/clk/clk-gate.c
drivers/clk/clk-mux.c
drivers/clk/clk.c
drivers/clk/clk_fixed_factor.c
drivers/clk/clk_fixed_rate.c

index 12288e10b39c4ea5162078fd9730a9de7cb7e349..6eb2b8133a3b958d017e5a5ddf5e3ea2807b389f 100644 (file)
@@ -4,9 +4,12 @@
  * Copyright 2019 NXP
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk.h>
 #include <clk-uclass.h>
+#include <log.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <dm/device.h>
index 9df50a5e7238e28e2fb0bf77563588e8f7489533..7e8e62feeeeb27ae701ffbffe730155a1837534d 100644 (file)
@@ -9,14 +9,18 @@
  *
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <asm/io.h>
 #include <malloc.h>
 #include <clk-uclass.h>
+#include <log.h>
 #include <dm/device.h>
 #include <dm/devres.h>
 #include <dm/uclass.h>
 #include <dm/lists.h>
+#include <dm/device_compat.h>
 #include <dm/device-internal.h>
 #include <linux/bug.h>
 #include <linux/clk-provider.h>
@@ -190,7 +194,7 @@ static struct clk *_register_divider(struct device *dev, const char *name,
 
        if (clk_divider_flags & CLK_DIVIDER_HIWORD_MASK) {
                if (width + shift > 16) {
-                       pr_warn("divider value exceeds LOWORD field\n");
+                       dev_warn(dev, "divider value exceeds LOWORD field\n");
                        return ERR_PTR(-EINVAL);
                }
        }
index 9fcf30fd2e48b0265a5ff651f5e2da4e77673474..2a446788e191dc4b62db4d4b64ef8fb567b4217c 100644 (file)
@@ -5,10 +5,14 @@
  *
  * Copyright (C) 2011 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
  */
+
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk.h>
 #include <clk-uclass.h>
 #include <div64.h>
+#include <log.h>
 #include <malloc.h>
 #include <dm/device.h>
 #include <dm/devres.h>
index 708499d95aeab061010801802d7c139f91646b20..aa40daf3d79c28b8742ac35dd47f82e1182178bb 100644 (file)
@@ -7,12 +7,16 @@
  * Gated clock implementation
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk.h>
+#include <log.h>
 #include <clk-uclass.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <dm/device.h>
+#include <dm/device_compat.h>
 #include <dm/devres.h>
 #include <linux/bitops.h>
 #include <linux/clk-provider.h>
@@ -124,7 +128,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
 
        if (clk_gate_flags & CLK_GATE_HIWORD_MASK) {
                if (bit_idx > 15) {
-                       pr_err("gate bit exceeds LOWORD field\n");
+                       dev_err(dev, "gate bit exceeds LOWORD field\n");
                        return ERR_PTR(-EINVAL);
                }
        }
index fd746f2de37e489110b2b741cd7db59b4c46cac4..b49946fbcd58ec06f2c37326ca1576b5ae4e6a20 100644 (file)
  * clock.
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk.h>
 #include <clk-uclass.h>
+#include <log.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <dm/device.h>
+#include <dm/device_compat.h>
 #include <dm/devres.h>
 #include <dm/uclass.h>
 #include <linux/bitops.h>
@@ -124,7 +128,7 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent)
 
        index = clk_fetch_parent_index(clk, parent);
        if (index < 0) {
-               printf("Could not fetch index\n");
+               log_err("Could not fetch index\n");
                return index;
        }
 
@@ -170,7 +174,7 @@ struct clk *clk_hw_register_mux_table(struct device *dev, const char *name,
        if (clk_mux_flags & CLK_MUX_HIWORD_MASK) {
                width = fls(mask) - ffs(mask) + 1;
                if (width + shift > 16) {
-                       pr_err("mux value exceeds LOWORD field\n");
+                       dev_err(dev, "mux value exceeds LOWORD field\n");
                        return ERR_PTR(-EINVAL);
                }
        }
index d1a9787071e53c24817a1cd457e004794cdce7d8..eff0fa134f7aec84a29acfde83cbf30b988e8d0b 100644 (file)
@@ -4,6 +4,8 @@
  * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk.h>
 #include <clk-uclass.h>
@@ -22,24 +24,24 @@ int clk_register(struct clk *clk, const char *drv_name,
 
        ret = uclass_get_device_by_name(UCLASS_CLK, parent_name, &parent);
        if (ret) {
-               printf("%s: failed to get %s device (parent of %s)\n",
-                      __func__, parent_name, name);
+               log_err("%s: failed to get %s device (parent of %s)\n",
+                       __func__, parent_name, name);
        } else {
-               debug("%s: name: %s parent: %s [0x%p]\n", __func__, name,
-                     parent->name, parent);
+               log_debug("%s: name: %s parent: %s [0x%p]\n", __func__, name,
+                         parent->name, parent);
        }
 
        drv = lists_driver_lookup_name(drv_name);
        if (!drv) {
-               printf("%s: %s is not a valid driver name\n",
-                      __func__, drv_name);
+               log_err("%s: %s is not a valid driver name\n",
+                       __func__, drv_name);
                return -ENOENT;
        }
 
        ret = device_bind(parent, drv, name, NULL, ofnode_null(), &clk->dev);
        if (ret) {
-               printf("%s: CLK: %s driver bind error [%d]!\n", __func__, name,
-                      ret);
+               log_err("%s: CLK: %s driver bind error [%d]!\n", __func__, name,
+                       ret);
                return ret;
        }
 
index 41b0d9c0603ed9929e955b37b0450c1785a94e9a..6c1139e5c519fbba93dde1aa4194fcd40efd7a59 100644 (file)
@@ -5,10 +5,13 @@
  * Author: Anup Patel <anup.patel@wdc.com>
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk-uclass.h>
 #include <div64.h>
 #include <dm.h>
+#include <log.h>
 #include <linux/err.h>
 
 struct clk_fixed_factor {
index c5a2a42c923c00bc1c3bfdc723df92a9efe8f222..b5e78c70559ed6e067c26157a4e866cb87f829d1 100644 (file)
@@ -3,9 +3,12 @@
  * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
+#define LOG_CATEGORY UCLASS_CLK
+
 #include <common.h>
 #include <clk-uclass.h>
 #include <dm.h>
+#include <log.h>
 #include <dm/device-internal.h>
 #include <linux/clk-provider.h>