[PATCH 05/18] log: Expose log_device_find_by_name
Sean Anderson
seanga2 at gmail.com
Tue Oct 6 21:15:57 CEST 2020
This function is required by "cmd: log: Add commands to manipulate filters".
Signed-off-by: Sean Anderson <seanga2 at gmail.com>
---
common/log.c | 2 +-
include/log.h | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/common/log.c b/common/log.c
index 09e39b0eca..bcb9e2634a 100644
--- a/common/log.c
+++ b/common/log.c
@@ -93,7 +93,7 @@ enum log_level_t log_get_level_by_name(const char *name)
return LOGL_NONE;
}
-static struct log_device *log_device_find_by_name(const char *drv_name)
+struct log_device *log_device_find_by_name(const char *drv_name)
{
struct log_device *ldev;
diff --git a/include/log.h b/include/log.h
index 670b9a665d..3496382bda 100644
--- a/include/log.h
+++ b/include/log.h
@@ -402,6 +402,14 @@ const char *log_get_level_name(enum log_level_t level);
*/
enum log_level_t log_get_level_by_name(const char *name);
+/**
+ * log_device_find_by_name() - Look up a log device by its driver's name
+ *
+ * @drv_name: Name of the driver
+ * @return the log device, or NULL if not found
+ */
+struct log_device *log_device_find_by_name(const char *drv_name);
+
/* Log format flags (bit numbers) for gd->log_fmt. See log_fmt_chars */
enum log_fmt {
LOGF_CAT = 0,
--
2.28.0
More information about the U-Boot
mailing list