diff options
author | Martin Kaiser <martin@kaiser.cx> | 2023-07-02 20:35:03 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-07-20 13:16:23 +0300 |
commit | 6a52ee38c79825ef469ab3ed8588d17e90d2049c (patch) | |
tree | 1d5cc310cb1526aba3122ac3ffebdd319813fee0 /drivers/char/hw_random | |
parent | 039980de89dc9dd757418d6f296e4126cc3f86c3 (diff) | |
download | linux-6a52ee38c79825ef469ab3ed8588d17e90d2049c.tar.xz |
hwrng: nomadik - use dev_err_probe
Use dev_err_probe to print a message and return an error. This makes the
code a tiny bit shorter.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r-- | drivers/char/hw_random/nomadik-rng.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c index 3774adf903a8..8c6a40d6ce3d 100644 --- a/drivers/char/hw_random/nomadik-rng.c +++ b/drivers/char/hw_random/nomadik-rng.c @@ -39,11 +39,8 @@ static int nmk_rng_probe(struct amba_device *dev, const struct amba_id *id) int ret; rng_clk = devm_clk_get_enabled(&dev->dev, NULL); - if (IS_ERR(rng_clk)) { - dev_err(&dev->dev, "could not get rng clock\n"); - ret = PTR_ERR(rng_clk); - return ret; - } + if (IS_ERR(rng_clk)) + return dev_err_probe(&dev->dev, PTR_ERR(rng_clk), "could not get rng clock\n"); ret = amba_request_regions(dev, dev->dev.init_name); if (ret) |