diff mbox series

[v2] hwrng: optee: Use device-managed registration API

Message ID 1612355166-11824-1-git-send-email-tiantao6@hisilicon.com
State Superseded
Headers show
Series [v2] hwrng: optee: Use device-managed registration API | expand

Commit Message

Tian Tao Feb. 3, 2021, 12:26 p.m. UTC
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>
---
v2:Fix up subject line as s/hwrng: optee -:/hwrng: optee:/
---
 drivers/char/hw_random/optee-rng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Herbert Xu Feb. 10, 2021, 7:23 a.m. UTC | #1
On Wed, Feb 03, 2021 at 08:26:06PM +0800, Tian Tao wrote:
> 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>

> ---

> v2:Fix up subject line as s/hwrng: optee -:/hwrng: optee:/

> ---

>  drivers/char/hw_random/optee-rng.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)


Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
index a99d829..135a825 100644
--- a/drivers/char/hw_random/optee-rng.c
+++ b/drivers/char/hw_random/optee-rng.c
@@ -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 @@  static int optee_rng_probe(struct device *dev)
 
 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);