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:
committed by
Leo Yu-Chi Liang
parent
84b48a9181
commit
c7c969d7e2
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user