diff options
author | 2023-02-14 17:28:28 +0100 | |
---|---|---|
committer | 2023-03-10 19:10:10 +0800 | |
commit | 67fb1e2958391ff005a049a147aa82920aef7921 (patch) | |
tree | 6cc6a3b6e8dda63a774c079fbcc8ec4823179357 /crypto/scompress.c | |
parent | hwrng: xgene - Simplify using dev_err_probe() (diff) | |
download | wireguard-linux-67fb1e2958391ff005a049a147aa82920aef7921.tar.xz wireguard-linux-67fb1e2958391ff005a049a147aa82920aef7921.zip |
hwrng: xgene - Simplify using devm_clk_get_optional_enabled()
Instead of ignoring errors returned by devm_clk_get() and manually
enabling the clk for the whole lifetime of the bound device, use
devm_clk_get_optional_enabled(). This is simpler and also more correct
as it doesn't ignore errors. This is also more correct because now the
call to clk_disable_unprepare() can be dropped from xgene_rng_remove()
which happened while the hwrn device was still registered. With the devm
callback disabling the clk happens correctly only after
devm_hwrng_register() is undone.
As a result struct xgene_rng_dev::clk is only used in xgene_rng_probe, and
so the struct member can be replaced by a local variable.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/scompress.c')
0 files changed, 0 insertions, 0 deletions