diff mbox series

[v3,17/19] bootstd: Export bootdev_get_from_blk()

Message ID 20241104175110.1048449-18-sjg@chromium.org
State Needs Review / ACK
Delegated to: Tom Rini
Headers show
Series bootstd: Support recording images | expand

Commit Message

Simon Glass Nov. 4, 2024, 5:51 p.m. UTC
Export this function so it can be used from other files.

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

Changes in v3:
- Add new patch to export bootdev_get_from_blk()

 boot/bootdev-uclass.c | 2 +-
 include/bootdev.h     | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c
index a4e1d79ec9b..65a3b89e40c 100644
--- a/boot/bootdev-uclass.c
+++ b/boot/bootdev-uclass.c
@@ -319,7 +319,7 @@  int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp)
 	return 0;
 }
 
-static int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp)
+int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp)
 {
 	struct udevice *parent = dev_get_parent(blk);
 	struct udevice *bootdev;
diff --git a/include/bootdev.h b/include/bootdev.h
index 991b6229c1c..12c90c4ec1b 100644
--- a/include/bootdev.h
+++ b/include/bootdev.h
@@ -401,6 +401,15 @@  static int bootdev_setup_for_sibling_blk(struct udevice *blk,
  */
 int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp);
 
+/**
+ * bootdev_get_from_blk() - Get the bootdev given a block device
+ *
+ * @blk: Block device to check
+ * @bootdebp: Returns the bootdev found, if any
+ * Return 0 if OK, -ve on error
+ */
+int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp);
+
 /**
  * bootdev_unbind_dev() - Unbind a bootdev device
  *