summaryrefslogtreecommitdiff
path: root/drivers/rng
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-11-04 09:00:07 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-01-09 07:36:18 +0100
commitbadef4cd4a9154776238cb1fad6d22bc93340303 (patch)
treeee6dec799677449f7b4d2c3f4a02d00d3186ba6e /drivers/rng
parentc5e461fbf7cc72f0c1c8a79226b6a5170e56cb4d (diff)
downloadu-boot-badef4cd4a9154776238cb1fad6d22bc93340303.tar.gz
u-boot-badef4cd4a9154776238cb1fad6d22bc93340303.tar.bz2
u-boot-badef4cd4a9154776238cb1fad6d22bc93340303.zip
rng: fix ARMv8.5 RNDR driver
In different parts of our code we assume that the first RNG device is the one to be used. Therefore it is preferable to detect the availability of the RNDR register already in the bind method. For signaling the non-existence of a device the driver model requires using ENOENT (and not ENODEV). Fixes: 31565bb0aa2d ("driver: rng: Add DM_RNG interface for ARMv8.5 RNDR registers") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/rng')
-rw-r--r--drivers/rng/arm_rndr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rng/arm_rndr.c b/drivers/rng/arm_rndr.c
index 55989743ea..4512330e68 100644
--- a/drivers/rng/arm_rndr.c
+++ b/drivers/rng/arm_rndr.c
@@ -62,10 +62,10 @@ static const struct dm_rng_ops arm_rndr_ops = {
.read = arm_rndr_read,
};
-static int arm_rndr_probe(struct udevice *dev)
+static int arm_rndr_bind(struct udevice *dev)
{
if (!cpu_has_rndr())
- return -ENODEV;
+ return -ENOENT;
return 0;
}
@@ -74,7 +74,7 @@ U_BOOT_DRIVER(arm_rndr) = {
.name = DRIVER_NAME,
.id = UCLASS_RNG,
.ops = &arm_rndr_ops,
- .probe = arm_rndr_probe,
+ .bind = arm_rndr_bind,
};
U_BOOT_DRVINFO(cpu_arm_rndr) = {