[PATCH] hwrng: rockchip: propagate reset errors
Pengpeng Hou
pengpeng at iscas.ac.cn
Sun Aug 30 06:36:52 PDT 2026
rk_rng_probe() pulses the optional or required reset array before
registering
the hardware RNG, but discards errors from both reset operations.
Return reset failures before publishing the RNG device.
Fixes: 8eff8eb83fc0 ("hwrng: rockchip - add support for rk3588's standalone TRNG")
Signed-off-by: Pengpeng Hou <pengpeng at iscas.ac.cn>
---
drivers/char/hw_random/rockchip-rng.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/rockchip-rng.c b/drivers/char/hw_random/rockchip-rng.c
index 6e3ed4b856051..ff98fcdc68911 100644
--- a/drivers/char/hw_random/rockchip-rng.c
+++ b/drivers/char/hw_random/rockchip-rng.c
@@ -412,9 +412,14 @@ static int rk_rng_probe(struct platform_device *pdev)
if (IS_ERR(rst))
return dev_err_probe(dev, PTR_ERR(rst), "Failed to get reset property\n");
- reset_control_assert(rst);
+ ret = reset_control_assert(rst);
+ if (ret)
+ return ret;
+
udelay(2);
- reset_control_deassert(rst);
+ ret = reset_control_deassert(rst);
+ if (ret)
+ return ret;
}
platform_set_drvdata(pdev, rk_rng);
base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
--
2.50.1
More information about the linux-arm-kernel
mailing list