dm: migrate the dm_warn to use the log macro
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 30 Jul 2021 10:13:11 +0000 (12:13 +0200)
committerSimon Glass <sjg@chromium.org>
Sun, 8 Aug 2021 17:27:27 +0000 (11:27 -0600)
Migrate the dm_warn function to log macro with
LOGC_DM category and LOGL_WARNING level.

This macro allows filtering with log command and allows
output on all log backend.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/util.c
include/dm/util.h

index 91e93b0..5be4ee7 100644 (file)
 #include <linux/libfdt.h>
 #include <vsprintf.h>
 
-#if CONFIG_IS_ENABLED(DM_WARN)
-void dm_warn(const char *fmt, ...)
-{
-       va_list args;
-
-       va_start(args, fmt);
-       vprintf(fmt, args);
-       va_end(args);
-}
-#endif
-
 int list_count_items(struct list_head *head)
 {
        struct list_head *node;
index 138893c..c634e47 100644 (file)
@@ -7,7 +7,7 @@
 #define __DM_UTIL_H
 
 #if CONFIG_IS_ENABLED(DM_WARN)
-void dm_warn(const char *fmt, ...);
+#define dm_warn(fmt...) log(LOGC_DM, LOGL_WARNING, ##fmt)
 #else
 static inline void dm_warn(const char *fmt, ...)
 {