hwrng: optee - Use device-managed registration API

Use devm_hwrng_register to get rid of manual unregistration.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Tian Tao 2021-02-03 20:26:06 +08:00 committed by Herbert Xu
parent fc754c024a
commit 14ab6de485
1 changed files with 1 additions and 2 deletions

View File

@ -243,7 +243,7 @@ static int optee_rng_probe(struct device *dev)
if (err)
goto out_sess;
err = hwrng_register(&pvt_data.optee_rng);
err = devm_hwrng_register(dev, &pvt_data.optee_rng);
if (err) {
dev_err(dev, "hwrng registration failed (%d)\n", err);
goto out_sess;
@ -263,7 +263,6 @@ out_ctx:
static int optee_rng_remove(struct device *dev)
{
hwrng_unregister(&pvt_data.optee_rng);
tee_client_close_session(pvt_data.ctx, pvt_data.session_id);
tee_client_close_context(pvt_data.ctx);