]> git.sur5r.net Git - u-boot/blobdiff - drivers/block/blk-uclass.c
configs: orangepi-pc2: Enable USB OTG peripheral mode
[u-boot] / drivers / block / blk-uclass.c
index aee2a50d6269248609ef3a6cef0aae2a07127797..9e0c8239690d295406872a695629a248f33952f3 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2016 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -10,6 +9,7 @@
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
+#include <dm/uclass-internal.h>
 
 static const char *if_typename_str[IF_TYPE_COUNT] = {
        [IF_TYPE_IDE]           = "ide",
@@ -21,8 +21,8 @@ static const char *if_typename_str[IF_TYPE_COUNT] = {
        [IF_TYPE_SD]            = "sd",
        [IF_TYPE_SATA]          = "sata",
        [IF_TYPE_HOST]          = "host",
-       [IF_TYPE_SYSTEMACE]     = "ace",
        [IF_TYPE_NVME]          = "nvme",
+       [IF_TYPE_EFI]           = "efi",
 };
 
 static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = {
@@ -36,7 +36,7 @@ static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = {
        [IF_TYPE_SATA]          = UCLASS_AHCI,
        [IF_TYPE_HOST]          = UCLASS_ROOT,
        [IF_TYPE_NVME]          = UCLASS_NVME,
-       [IF_TYPE_SYSTEMACE]     = UCLASS_INVALID,
+       [IF_TYPE_EFI]           = UCLASS_EFI,
 };
 
 static enum if_type if_typename_to_iftype(const char *if_typename)
@@ -294,9 +294,6 @@ ulong blk_read_devnum(enum if_type if_type, int devnum, lbaint_t start,
        if (IS_ERR_VALUE(n))
                return n;
 
-       /* flush cache after read */
-       flush_cache((ulong)buffer, blkcnt * desc->blksz);
-
        return n;
 }
 
@@ -334,7 +331,7 @@ int blk_first_device(int if_type, struct udevice **devp)
        struct blk_desc *desc;
        int ret;
 
-       ret = uclass_first_device(UCLASS_BLK, devp);
+       ret = uclass_find_first_device(UCLASS_BLK, devp);
        if (ret)
                return ret;
        if (!*devp)
@@ -343,7 +340,7 @@ int blk_first_device(int if_type, struct udevice **devp)
                desc = dev_get_uclass_platdata(*devp);
                if (desc->if_type == if_type)
                        return 0;
-               ret = uclass_next_device(devp);
+               ret = uclass_find_next_device(devp);
                if (ret)
                        return ret;
        } while (*devp);
@@ -359,7 +356,7 @@ int blk_next_device(struct udevice **devp)
        desc = dev_get_uclass_platdata(*devp);
        if_type = desc->if_type;
        do {
-               ret = uclass_next_device(devp);
+               ret = uclass_find_next_device(devp);
                if (ret)
                        return ret;
                if (!*devp)