diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-06-08 19:04:22 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-10 03:57:22 +0300 |
commit | 6c9e4175491900b9fa5d9283c4a449f00285162d (patch) | |
tree | 1b37e8f20cc9768c0b44f58e4a4562aeb7116ffe | |
parent | e85497a930b21cc5b2c5ac220c9ed1668341d30c (diff) | |
download | u-boot-6c9e4175491900b9fa5d9283c4a449f00285162d.tar.xz |
log: uclass_get_name() depends on CONFIG_SPL_DM
If CONFIG_SPL_DM=n and CONFIG_SPL_LOG=y a build error occurs:
ld.bfd: common/built-in.o: in function `log_get_cat_name':
common/log.c:48: undefined reference to `uclass_get_name'
make[1]: *** [scripts/Makefile.spl:422: spl/u-boot-spl] Error 1
Call uclass_get_name() only if DM is enabled.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/log.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/log.c b/common/log.c index c5b9b489ca..d7ce74f6b3 100644 --- a/common/log.c +++ b/common/log.c @@ -45,7 +45,11 @@ const char *log_get_cat_name(enum log_category_t cat) if (cat >= LOGC_NONE) return log_cat_name[cat - LOGC_NONE]; +#if CONFIG_IS_ENABLED(DM) name = uclass_get_name((enum uclass_id)cat); +#else + name = NULL; +#endif return name ? name : "<missing>"; } |