]> Git Repo - J-u-boot.git/blobdiff - cmd/bcb.c
Azure CI: Save pytest output automatically
[J-u-boot.git] / cmd / bcb.c
index 92f4d27990df981e66d766dd4c4b4dd7c2f56a03..02d0c70d87e24a4e99daaa5691b25c71bae32e1d 100644 (file)
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -9,10 +9,12 @@
 #include <bcb.h>
 #include <command.h>
 #include <common.h>
+#include <display_options.h>
 #include <log.h>
 #include <part.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <linux/err.h>
 
 enum bcb_cmd {
        BCB_CMD_LOAD,
@@ -121,12 +123,22 @@ static int __bcb_load(int devnum, const char *partp)
        char *endp;
        int part, ret;
 
-       desc = blk_get_devnum_by_type(IF_TYPE_MMC, devnum);
+       desc = blk_get_devnum_by_uclass_id(UCLASS_MMC, devnum);
        if (!desc) {
                ret = -ENODEV;
                goto err_read_fail;
        }
 
+       /*
+        * always select the USER mmc hwpart in case another
+        * blk operation selected a different hwpart
+        */
+       ret = blk_dselect_hwpart(desc, 0);
+       if (IS_ERR_VALUE(ret)) {
+               ret = -ENODEV;
+               goto err_read_fail;
+       }
+
        part = simple_strtoul(partp, &endp, 0);
        if (*endp == '\0') {
                ret = part_get_info(desc, part, &info);
@@ -286,7 +298,7 @@ static int __bcb_store(void)
        u64 cnt;
        int ret;
 
-       desc = blk_get_devnum_by_type(IF_TYPE_MMC, bcb_dev);
+       desc = blk_get_devnum_by_uclass_id(UCLASS_MMC, bcb_dev);
        if (!desc) {
                ret = -ENODEV;
                goto err;
This page took 0.027295 seconds and 4 git commands to generate.