static void getvar_partition_type(char *part_name, char *response) { int r; struct blk_desc *dev_desc; disk_partition_t part_info; r = fastboot_mmc_get_part_info(part_name, &dev_desc, &part_info, response); if (r >= 0) { r = fs_set_blk_dev_with_part(dev_desc, r); if (r < 0) fastboot_fail("failed to set partition", response); else fastboot_okay(fs_get_type_name(), response); } }
static int select_fs_dev(struct device_platdata *plat) { int ret; if (plat->phandlepart.phandle) { ofnode node; node = ofnode_get_by_phandle(plat->phandlepart.phandle); struct udevice *dev; ret = device_get_global_by_ofnode(node, &dev); if (!ret) { struct blk_desc *desc = blk_get_by_device(dev); if (desc) { ret = fs_set_blk_dev_with_part(desc, plat->phandlepart.partition); } else { debug("%s: No device found\n", __func__); return -ENODEV; } } } else if (plat->mtdpart && plat->ubivol) { ret = mount_ubifs(plat->mtdpart, plat->ubivol); if (ret) return ret; ret = fs_set_blk_dev("ubi", NULL, FS_TYPE_UBIFS); } else { debug("Error: unsupported storage device.\n"); return -ENODEV; } if (ret) debug("Error: could not access storage.\n"); return ret; }
static int set_blk_dev(struct file_handle *fh) { return fs_set_blk_dev_with_part(fh->fs->desc, fh->fs->part); }