rng: jh7110: Fix invalid usage of dev_read_addr

dev_read_addr returns FDT_ADDR_T_NONE (-1), not NULL,
in case of errors.
Replace dev_read_addr by dev_read_addr_ptr.
Replace error to EINVAL.

Signed-off-by: Francois Berder <fberder@outlook.fr>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
This commit is contained in:
Francois Berder
2026-07-26 19:39:22 -07:00
committed by Leo Yu-Chi Liang
parent 84b48a9181
commit c7c969d7e2
+2 -2
View File
@@ -233,9 +233,9 @@ static int starfive_trng_of_to_plat(struct udevice *dev)
{
struct starfive_trng_plat *pdata = dev_get_plat(dev);
pdata->base = (void *)dev_read_addr(dev);
pdata->base = dev_read_addr_ptr(dev);
if (!pdata->base)
return -ENODEV;
return -EINVAL;
pdata->hclk = devm_clk_get(dev, "hclk");
if (IS_ERR(pdata->hclk))