-#else
-int host_dev_bind(int dev, char *filename, bool removable)
-{
- struct host_block_dev *host_dev = find_host_device(dev);
-
- if (!host_dev)
- return -1;
- if (host_dev->blk_dev.priv) {
- os_close(host_dev->fd);
- host_dev->blk_dev.priv = NULL;
- }
- if (host_dev->filename)
- free(host_dev->filename);
- if (filename && *filename) {
- host_dev->filename = strdup(filename);
- } else {
- host_dev->filename = NULL;
- return 0;
- }
-
- host_dev->fd = os_open(host_dev->filename, OS_O_RDWR);
- if (host_dev->fd == -1) {
- printf("Failed to access host backing file '%s'\n",
- host_dev->filename);
- return 1;
- }
-
- struct blk_desc *blk_dev = &host_dev->blk_dev;
- blk_dev->uclass_id = UCLASS_ROOT;
- blk_dev->priv = host_dev;
- blk_dev->blksz = 512;
- blk_dev->lba = os_lseek(host_dev->fd, 0, OS_SEEK_END) / blk_dev->blksz;
- blk_dev->block_read = host_block_read;
- blk_dev->block_write = host_block_write;
- blk_dev->devnum = dev;
- blk_dev->part_type = PART_TYPE_UNKNOWN;
- blk_dev->removable = removable;
- snprintf(blk_dev->vendor, BLK_VEN_SIZE, "U-Boot");
- snprintf(blk_dev->product, BLK_PRD_SIZE, "hostfile");
- snprintf(blk_dev->revision, BLK_REV_SIZE, "1.0");
- part_init(blk_dev);
-
- return 0;
-}
-#endif