From: Simon Glass Date: Mon, 15 Mar 2021 04:25:18 +0000 (+1300) Subject: dm: core: Skip adding uclasses with OF_PLATDATA_INST X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=91bcfdf0b6683681c557db55e1d74424fb1cc4fe;p=u-boot.git 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 Signed-off-by: Simon Glass --- 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;