diff mbox series

[v2,2/8] bootstd: Avoid calling unavailable block functions

Message ID 20240823204824.443631-3-sjg@chromium.org
State Superseded
Delegated to: Andre Przywara
Headers show
Series bootstd: sunxi: Migrate to standard boot | expand

Commit Message

Simon Glass Aug. 23, 2024, 8:48 p.m. UTC
When BLK is not enabled but BOOTSTD is, some features of standard boot
become unavailable. Add a check for this in the only site that is
currently apparent.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 boot/bootdev-uclass.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c
index 7c7bba088c9..e10be2baa30 100644
--- a/boot/bootdev-uclass.c
+++ b/boot/bootdev-uclass.c
@@ -434,6 +434,9 @@  int bootdev_find_by_label(const char *label, struct udevice **devp,
 	struct uclass *uc;
 	enum uclass_id id;
 
+	if (!CONFIG_IS_ENABLED(BLK))
+		return -ENOSYS;
+
 	ret = label_to_uclass(label, &seq, &method_flags);
 	if (ret < 0)
 		return log_msg_ret("uc", ret);