diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-15 07:25:18 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-22 09:23:28 +0300 |
commit | 91bcfdf0b6683681c557db55e1d74424fb1cc4fe (patch) | |
tree | afb498716b5b8e8d1474a6b614f94cab7b422d11 /drivers/core/uclass.c | |
parent | 967a7d483ac5b9075d83c59507c8020636000842 (diff) | |
download | u-boot-91bcfdf0b6683681c557db55e1d74424fb1cc4fe.tar.xz |
dm: core: Skip adding uclasses with OF_PLATDATA_INST
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@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r-- | drivers/core/uclass.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 1a4ea7a57a..f753a1f91e 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -148,8 +148,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; |