Skip to content

Commit

Permalink
hwrng: ks-sa - use dev_err_probe
Browse files Browse the repository at this point in the history
Replace dev_err + return with dev_err_probe.

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 Sep 15, 2023
1 parent 2db1809 commit 337be41
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/char/hw_random/ks-sa-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,14 @@ static int ks_sa_rng_probe(struct platform_device *pdev)
syscon_regmap_lookup_by_phandle(dev->of_node,
"ti,syscon-sa-cfg");

if (IS_ERR(ks_sa_rng->regmap_cfg)) {
dev_err(dev, "syscon_node_to_regmap failed\n");
return -EINVAL;
}
if (IS_ERR(ks_sa_rng->regmap_cfg))
return dev_err_probe(dev, -EINVAL, "syscon_node_to_regmap failed\n");

pm_runtime_enable(dev);
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "Failed to enable SA power-domain\n");
pm_runtime_disable(dev);
return ret;
return dev_err_probe(dev, ret, "Failed to enable SA power-domain\n");
}

return devm_hwrng_register(&pdev->dev, &ks_sa_rng->rng);
Expand Down

0 comments on commit 337be41

Please sign in to comment.