From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Wed, 3 Feb 2021 09:43:23 -0700 Subject: [PATCH v2 07/37] dm: core: Skip adding uclasses with OF_PLATDATA_INST In-Reply-To: <20210203164353.2577985-1-sjg@chromium.org> References: <20210203164353.2577985-1-sjg@chromium.org> Message-ID: <20210203094345.v2.7.Icde748d3063580acf92b185f675701c077b72ba8@changeid> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- (no changes since v1) 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 f38122d54b5..2a7b0881b18 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.30.0.365.g02bc693789-goog