aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass2020-10-03 11:31:26 -0600
committerSimon Glass2020-10-29 14:42:17 -0600
commitabb9cd30b23858125ce015c1dffdae4d7895bae8 (patch)
treedfc71c65c860718f1654e3c67e3fa575a31e099b /drivers/core
parent1b27273e090590e7944a3f7a3b33ac9f90aae765 (diff)
dm: core: Allow dm_warn() to be used in SPL
At present this option is disabled in SPL, meaning that warnings are not displayed. It is sometimes useful to see warnings in SPL for debugging purposes. Add a new Kconfig option to permit this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/Kconfig18
-rw-r--r--drivers/core/util.c2
2 files changed, 17 insertions, 3 deletions
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig
index 07d3a6a7a43..ffae6f9795f 100644
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -40,10 +40,24 @@ config DM_WARN
depends on DM
default y
help
+ Enable this to see warnings related to driver model.
+
+ Warnings may help with debugging, such as when expected devices do
+ not bind correctly. If the option is disabled, dm_warn() is compiled
+ out - it will do nothing when called.
+
+config SPL_DM_WARN
+ bool "Enable warnings in driver model wuth SPL"
+ depends on SPL_DM
+ help
+ Enable this to see warnings related to driver model in SPL
+
The dm_warn() function can use up quite a bit of space for its
strings. By default this is disabled for SPL builds to save space.
- This will cause dm_warn() to be compiled out - it will do nothing
- when called.
+
+ Warnings may help with debugging, such as when expected devices do
+ not bind correctly. If the option is disabled, dm_warn() is compiled
+ out - it will do nothing when called.
config DM_DEBUG
bool "Enable debug messages in driver model core"
diff --git a/drivers/core/util.c b/drivers/core/util.c
index 25b0d76f430..91e93b0cf14 100644
--- a/drivers/core/util.c
+++ b/drivers/core/util.c
@@ -11,7 +11,7 @@
#include <linux/libfdt.h>
#include <vsprintf.h>
-#ifdef CONFIG_DM_WARN
+#if CONFIG_IS_ENABLED(DM_WARN)
void dm_warn(const char *fmt, ...)
{
va_list args;