[PATCH 07/30] dm: core: Skip adding uclasses with OF_PLATDATA_INST
Simon Glass
sjg at chromium.org
Thu Dec 31 05:09:37 CET 2020
There is no need to ever add new uclasses since these are set up at build
time. Update the code to return an error if this is attempted.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
drivers/core/uclass.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index cdb975d5b31..3a13b82b922 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -147,8 +147,11 @@ int uclass_get(enum uclass_id id, struct uclass **ucp)
*ucp = NULL;
uc = uclass_find(id);
- if (!uc)
+ if (!uc) {
+ if (CONFIG_IS_ENABLED(OF_PLATDATA_INST))
+ return -ENOENT;
return uclass_add(id, ucp);
+ }
*ucp = uc;
return 0;
--
2.29.2.729.g45daf8777d-goog
More information about the U-Boot
mailing list