]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootflow: Export setup_fs()
authorSimon Glass <sjg@chromium.org>
Thu, 27 Jul 2023 03:01:21 +0000 (21:01 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 3 Aug 2023 19:30:53 +0000 (15:30 -0400)
This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/bootmeth-uclass.c
include/bootmeth.h

index eeded08dd428472e7987f10c714c8b19e2424c01..175eb1de5e1e1e3b45d96463cb641e63c3a91bec 100644 (file)
@@ -240,18 +240,7 @@ int bootmeth_set_order(const char *order_str)
        return 0;
 }
 
-/**
- * setup_fs() - Set up read to read a file
- *
- * We must redo the setup before each filesystem operation. This function
- * handles that, including setting the filesystem type if a block device is not
- * being used
- *
- * @bflow: Information about file to try
- * @desc: Block descriptor to read from (NULL if not a block device)
- * Return: 0 if OK, -ve on error
- */
-static int setup_fs(struct bootflow *bflow, struct blk_desc *desc)
+int bootmeth_setup_fs(struct bootflow *bflow, struct blk_desc *desc)
 {
        int ret;
 
@@ -288,7 +277,7 @@ int bootmeth_try_file(struct bootflow *bflow, struct blk_desc *desc,
        log_debug("   %s - err=%d\n", path, ret);
 
        /* Sadly FS closes the file after fs_size() so we must redo this */
-       ret2 = setup_fs(bflow, desc);
+       ret2 = bootmeth_setup_fs(bflow, desc);
        if (ret2)
                return log_msg_ret("fs", ret2);
 
@@ -337,14 +326,14 @@ int bootmeth_alloc_other(struct bootflow *bflow, const char *fname,
        if (bflow->blk)
                desc = dev_get_uclass_plat(bflow->blk);
 
-       ret = setup_fs(bflow, desc);
+       ret = bootmeth_setup_fs(bflow, desc);
        if (ret)
                return log_msg_ret("fs", ret);
 
        ret = fs_size(path, &size);
        log_debug("   %s - err=%d\n", path, ret);
 
-       ret = setup_fs(bflow, desc);
+       ret = bootmeth_setup_fs(bflow, desc);
        if (ret)
                return log_msg_ret("fs", ret);
 
@@ -369,7 +358,7 @@ int bootmeth_common_read_file(struct udevice *dev, struct bootflow *bflow,
        if (bflow->blk)
                desc = dev_get_uclass_plat(bflow->blk);
 
-       ret = setup_fs(bflow, desc);
+       ret = bootmeth_setup_fs(bflow, desc);
        if (ret)
                return log_msg_ret("fs", ret);
 
@@ -379,7 +368,7 @@ int bootmeth_common_read_file(struct udevice *dev, struct bootflow *bflow,
        if (size > *sizep)
                return log_msg_ret("spc", -ENOSPC);
 
-       ret = setup_fs(bflow, desc);
+       ret = bootmeth_setup_fs(bflow, desc);
        if (ret)
                return log_msg_ret("fs", ret);
 
index c3df9702e871b9e6045c30eab13cceb87a20fc65..7cb7da33deaa8e5202f98fd73c894301ad80e16a 100644 (file)
@@ -262,6 +262,19 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global);
  */
 int bootmeth_set_order(const char *order_str);
 
+/**
+ * bootmeth_setup_fs() - Set up read to read a file
+ *
+ * We must redo the setup before each filesystem operation. This function
+ * handles that, including setting the filesystem type if a block device is not
+ * being used
+ *
+ * @bflow: Information about file to try
+ * @desc: Block descriptor to read from (NULL if not a block device)
+ * Return: 0 if OK, -ve on error
+ */
+int bootmeth_setup_fs(struct bootflow *bflow, struct blk_desc *desc);
+
 /**
  * bootmeth_try_file() - See we can access a given file
  *