Skip to content

Commit

Permalink
hwrng: rockchip - handle devm_pm_runtime_enable errors
Browse files Browse the repository at this point in the history
It's unlikely that devm_pm_runtime_enable ever fails. Still, it makes
sense to read the return value and handle errors.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
martin-kaiser authored and herbertx committed Aug 30, 2024
1 parent 9c27970 commit 866ff78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/char/hw_random/rockchip-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ static int rk_rng_probe(struct platform_device *pdev)

pm_runtime_set_autosuspend_delay(dev, RK_RNG_AUTOSUSPEND_DELAY);
pm_runtime_use_autosuspend(dev);
devm_pm_runtime_enable(dev);
ret = devm_pm_runtime_enable(dev);
if (ret)
return dev_err_probe(&pdev->dev, ret, "Runtime pm activation failed.\n");

ret = devm_hwrng_register(dev, &rk_rng->rng);
if (ret)
Expand Down

0 comments on commit 866ff78

Please sign in to comment.