]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
qemu: arm: Remove platform specific function to get RNG device
authorSughosh Ganu <sughosh.ganu@linaro.org>
Sun, 13 Mar 2022 14:47:58 +0000 (20:17 +0530)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 31 Mar 2022 17:06:16 +0000 (19:06 +0200)
The QEMU platform has a function defined to get the random number
generator(RNG) device. However, the RNG device can be obtained simply
by searching for a device belonging to the RNG uclass. Remove the
superfluous platform function defined for the QEMU platform for
getting the RNG device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
board/emulation/qemu-arm/qemu-arm.c

index 16d5a97167a6a8e5f26f6d6cda30ffe76a5ff2f3..c9e886e44a521021d63b072068e8d2cc41a0689a 100644 (file)
@@ -107,48 +107,6 @@ void enable_caches(void)
         dcache_enable();
 }
 
-#if defined(CONFIG_EFI_RNG_PROTOCOL)
-#include <efi_loader.h>
-#include <efi_rng.h>
-
-#include <dm/device-internal.h>
-
-efi_status_t platform_get_rng_device(struct udevice **dev)
-{
-       int ret;
-       efi_status_t status = EFI_DEVICE_ERROR;
-       struct udevice *bus, *devp;
-
-       for (uclass_first_device(UCLASS_VIRTIO, &bus); bus;
-            uclass_next_device(&bus)) {
-               for (device_find_first_child(bus, &devp); devp;
-                    device_find_next_child(&devp)) {
-                       if (device_get_uclass_id(devp) == UCLASS_RNG) {
-                               *dev = devp;
-                               status = EFI_SUCCESS;
-                               break;
-                       }
-               }
-       }
-
-       if (status != EFI_SUCCESS) {
-               debug("No rng device found\n");
-               return EFI_DEVICE_ERROR;
-       }
-
-       if (*dev) {
-               ret = device_probe(*dev);
-               if (ret)
-                       return EFI_DEVICE_ERROR;
-       } else {
-               debug("Couldn't get child device\n");
-               return EFI_DEVICE_ERROR;
-       }
-
-       return EFI_SUCCESS;
-}
-#endif /* CONFIG_EFI_RNG_PROTOCOL */
-
 #ifdef CONFIG_ARM64
 #define __W    "w"
 #else