]> git.sur5r.net Git - u-boot/blobdiff - drivers/block/sandbox.c
dm: blk: part: Add UCLASS_NVME and IF_TYPE_NVME
[u-boot] / drivers / block / sandbox.c
index 6d41508d5c17c15c388e5e2baae9545db35d324c..34d1c638bc7788755f10b76154e513ae1ec3c806 100644 (file)
@@ -12,7 +12,7 @@
 #include <os.h>
 #include <malloc.h>
 #include <sandboxblockdev.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <dm/device-internal.h>
 
 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