]> git.sur5r.net Git - u-boot/blobdiff - disk/part.c
spi: fsl_qspi: Fix issues on arm64
[u-boot] / disk / part.c
index 9a78cceadbc77971146882fc3a17fd13d0460c33..543cab8103204e0bc8fcba57e8b1b0474b4fe1bd 100644 (file)
 #define PRINTF(fmt,args...)
 #endif
 
-struct block_drvr {
-       char *name;
-       struct blk_desc* (*get_dev)(int dev);
-       int (*select_hwpart)(int dev_num, int hwpart);
-};
-
-static const struct block_drvr block_drvr[] = {
+const struct block_drvr block_drvr[] = {
 #if defined(CONFIG_CMD_IDE)
        { .name = "ide", .get_dev = ide_get_dev, },
 #endif
@@ -108,7 +102,7 @@ static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
                                return dev_desc;
                        if (!select_hwpart)
                                return NULL;
-                       ret = select_hwpart(dev_desc->dev, hwpart);
+                       ret = select_hwpart(dev_desc->devnum, hwpart);
                        if (ret < 0)
                                return NULL;
                        return dev_desc;
@@ -274,6 +268,8 @@ void part_init(struct blk_desc *dev_desc)
        const int n_ents = ll_entry_count(struct part_driver, part_driver);
        struct part_driver *entry;
 
+       blkcache_invalidate(dev_desc->if_type, dev_desc->devnum);
+
        dev_desc->part_type = PART_TYPE_UNKNOWN;
        for (entry = drv; entry != drv + n_ents; entry++) {
                int ret;
@@ -325,7 +321,7 @@ static void print_part_header(const char *type, struct blk_desc *dev_desc)
                break;
        }
        printf (" device %d  --   Partition Type: %s\n\n",
-                       dev_desc->dev, type);
+                       dev_desc->devnum, type);
 #endif /* any CONFIG_..._PARTITION */
 }
 
@@ -369,7 +365,8 @@ int part_get_info(struct blk_desc *dev_desc, int part,
                return -EPROTONOSUPPORT;
        }
        if (!drv->get_info) {
-               PRINTF("## Driver %s does not have the get_info() method\n");
+               PRINTF("## Driver %s does not have the get_info() method\n",
+                      drv->name);
                return -ENOSYS;
        }
        if (drv->get_info(dev_desc, part, info) == 0) {
@@ -457,10 +454,6 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
        int part;
        disk_partition_t tmpinfo;
 
-#if defined CONFIG_SANDBOX && defined CONFIG_CMD_UBIFS
-#error Only one of CONFIG_SANDBOX and CONFIG_CMD_UBIFS may be selected
-#endif
-
 #ifdef CONFIG_SANDBOX
        /*
         * Special-case a pseudo block device "hostfs", to allow access to the