X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fblock%2Fsandbox.c;h=34d1c638bc7788755f10b76154e513ae1ec3c806;hb=37a0c6008553f3bbd0db6bb8a88e3f5b0c7606eb;hp=6d41508d5c17c15c388e5e2baae9545db35d324c;hpb=88033d737d9f46e7eebda6a8f9770957eb9aae9c;p=u-boot diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c index 6d41508d5c..34d1c638bc 100644 --- a/drivers/block/sandbox.c +++ b/drivers/block/sandbox.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -98,7 +98,7 @@ int host_dev_bind(int devnum, char *filename) /* Remove and unbind the old device, if any */ ret = blk_get_device(IF_TYPE_HOST, devnum, &dev); if (ret == 0) { - ret = device_remove(dev); + ret = device_remove(dev, DM_REMOVE_NORMAL); if (ret) return ret; ret = device_unbind(dev); @@ -217,16 +217,6 @@ int host_get_dev_err(int devnum, struct blk_desc **blk_devp) return 0; } -struct blk_desc *host_get_dev(int dev) -{ - struct blk_desc *blk_dev; - - if (host_get_dev_err(dev, &blk_dev)) - return NULL; - - return blk_dev; -} - #ifdef CONFIG_BLK static const struct blk_ops sandbox_host_blk_ops = { .read = host_block_read, @@ -239,4 +229,11 @@ U_BOOT_DRIVER(sandbox_host_blk) = { .ops = &sandbox_host_blk_ops, .priv_auto_alloc_size = sizeof(struct host_block_dev), }; +#else +U_BOOT_LEGACY_BLK(sandbox_host) = { + .if_typename = "host", + .if_type = IF_TYPE_HOST, + .max_devs = CONFIG_HOST_MAX_DEVICES, + .get_dev = host_get_dev_err, +}; #endif