]> git.sur5r.net Git - u-boot/blobdiff - drivers/block/sandbox.c
spl, nand: add option CONFIG_SPL_NAND_IDENT to lookup for supported NAND chips
[u-boot] / drivers / block / sandbox.c
index ac28f834724490b23670ac3a3361310f53ee5c0a..0392437309e71f5dc0077bf90c5a8e7f8507a307 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2013 Henrik Nordstrom <henrik@henriknordstrom.net>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -12,7 +11,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 +97,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);
@@ -129,7 +128,7 @@ int host_dev_bind(int devnum, char *filename)
        }
        ret = blk_create_device(gd->dm_root, "sandbox_host_blk", str,
                                IF_TYPE_HOST, devnum, 512,
-                               os_lseek(fd, 0, OS_SEEK_END), &dev);
+                               os_lseek(fd, 0, OS_SEEK_END) / 512, &dev);
        if (ret)
                goto err_file;
        ret = device_probe(dev);