All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: atmel-sha204a: Use device-managed registration API
@ 2019-07-23  7:19 ` Chuhong Yuan
  0 siblings, 0 replies; 6+ messages in thread
From: Chuhong Yuan @ 2019-07-23  7:19 UTC (permalink / raw)
  Cc: Herbert Xu, David S . Miller, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-crypto, linux-arm-kernel, linux-kernel,
	Chuhong Yuan

Use devm_hwrng_register to get rid of manual
unregistration.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/crypto/atmel-sha204a.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
index ea0d2068ea4f..c96c14e7dab1 100644
--- a/drivers/crypto/atmel-sha204a.c
+++ b/drivers/crypto/atmel-sha204a.c
@@ -109,7 +109,7 @@ static int atmel_sha204a_probe(struct i2c_client *client,
 	i2c_priv->hwrng.read = atmel_sha204a_rng_read;
 	i2c_priv->hwrng.quality = 1024;
 
-	ret = hwrng_register(&i2c_priv->hwrng);
+	ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng);
 	if (ret)
 		dev_warn(&client->dev, "failed to register RNG (%d)\n", ret);
 
@@ -127,7 +127,6 @@ static int atmel_sha204a_remove(struct i2c_client *client)
 
 	if (i2c_priv->hwrng.priv)
 		kfree((void *)i2c_priv->hwrng.priv);
-	hwrng_unregister(&i2c_priv->hwrng);
 
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] crypto: atmel-sha204a: Use device-managed registration API
@ 2019-07-23  7:19 ` Chuhong Yuan
  0 siblings, 0 replies; 6+ messages in thread
From: Chuhong Yuan @ 2019-07-23  7:19 UTC (permalink / raw)
  Cc: Alexandre Belloni, Herbert Xu, Chuhong Yuan, linux-kernel,
	Ludovic Desroches, linux-crypto, David S . Miller,
	linux-arm-kernel

Use devm_hwrng_register to get rid of manual
unregistration.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/crypto/atmel-sha204a.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
index ea0d2068ea4f..c96c14e7dab1 100644
--- a/drivers/crypto/atmel-sha204a.c
+++ b/drivers/crypto/atmel-sha204a.c
@@ -109,7 +109,7 @@ static int atmel_sha204a_probe(struct i2c_client *client,
 	i2c_priv->hwrng.read = atmel_sha204a_rng_read;
 	i2c_priv->hwrng.quality = 1024;
 
-	ret = hwrng_register(&i2c_priv->hwrng);
+	ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng);
 	if (ret)
 		dev_warn(&client->dev, "failed to register RNG (%d)\n", ret);
 
@@ -127,7 +127,6 @@ static int atmel_sha204a_remove(struct i2c_client *client)
 
 	if (i2c_priv->hwrng.priv)
 		kfree((void *)i2c_priv->hwrng.priv);
-	hwrng_unregister(&i2c_priv->hwrng);
 
 	return 0;
 }
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] crypto: atmel-sha204a: Use device-managed registration API
  2019-07-23  7:19 ` Chuhong Yuan
@ 2019-07-31 12:04   ` Ludovic Desroches
  -1 siblings, 0 replies; 6+ messages in thread
From: Ludovic Desroches @ 2019-07-31 12:04 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Herbert Xu, David S . Miller, Nicolas Ferre, Alexandre Belloni,
	linux-crypto, linux-arm-kernel, linux-kernel

On Tue, Jul 23, 2019 at 03:19:36PM +0800, Chuhong Yuan wrote:
> 
> Use devm_hwrng_register to get rid of manual
> unregistration.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>

Thanks

> ---
>  drivers/crypto/atmel-sha204a.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
> index ea0d2068ea4f..c96c14e7dab1 100644
> --- a/drivers/crypto/atmel-sha204a.c
> +++ b/drivers/crypto/atmel-sha204a.c
> @@ -109,7 +109,7 @@ static int atmel_sha204a_probe(struct i2c_client *client,
>  	i2c_priv->hwrng.read = atmel_sha204a_rng_read;
>  	i2c_priv->hwrng.quality = 1024;
>  
> -	ret = hwrng_register(&i2c_priv->hwrng);
> +	ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng);
>  	if (ret)
>  		dev_warn(&client->dev, "failed to register RNG (%d)\n", ret);
>  
> @@ -127,7 +127,6 @@ static int atmel_sha204a_remove(struct i2c_client *client)
>  
>  	if (i2c_priv->hwrng.priv)
>  		kfree((void *)i2c_priv->hwrng.priv);
> -	hwrng_unregister(&i2c_priv->hwrng);
>  
>  	return 0;
>  }
> -- 
> 2.20.1
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] crypto: atmel-sha204a: Use device-managed registration API
@ 2019-07-31 12:04   ` Ludovic Desroches
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Desroches @ 2019-07-31 12:04 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Alexandre Belloni, Herbert Xu, linux-kernel, linux-crypto,
	David S . Miller, linux-arm-kernel

On Tue, Jul 23, 2019 at 03:19:36PM +0800, Chuhong Yuan wrote:
> 
> Use devm_hwrng_register to get rid of manual
> unregistration.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>

Thanks

> ---
>  drivers/crypto/atmel-sha204a.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
> index ea0d2068ea4f..c96c14e7dab1 100644
> --- a/drivers/crypto/atmel-sha204a.c
> +++ b/drivers/crypto/atmel-sha204a.c
> @@ -109,7 +109,7 @@ static int atmel_sha204a_probe(struct i2c_client *client,
>  	i2c_priv->hwrng.read = atmel_sha204a_rng_read;
>  	i2c_priv->hwrng.quality = 1024;
>  
> -	ret = hwrng_register(&i2c_priv->hwrng);
> +	ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng);
>  	if (ret)
>  		dev_warn(&client->dev, "failed to register RNG (%d)\n", ret);
>  
> @@ -127,7 +127,6 @@ static int atmel_sha204a_remove(struct i2c_client *client)
>  
>  	if (i2c_priv->hwrng.priv)
>  		kfree((void *)i2c_priv->hwrng.priv);
> -	hwrng_unregister(&i2c_priv->hwrng);
>  
>  	return 0;
>  }
> -- 
> 2.20.1
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] crypto: atmel-sha204a: Use device-managed registration API
  2019-07-23  7:19 ` Chuhong Yuan
@ 2019-08-02  4:54   ` Herbert Xu
  -1 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2019-08-02  4:54 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: David S . Miller, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, linux-crypto, linux-arm-kernel, linux-kernel

On Tue, Jul 23, 2019 at 03:19:36PM +0800, Chuhong Yuan wrote:
> Use devm_hwrng_register to get rid of manual
> unregistration.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/crypto/atmel-sha204a.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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] crypto: atmel-sha204a: Use device-managed registration API
@ 2019-08-02  4:54   ` Herbert Xu
  0 siblings, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2019-08-02  4:54 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Alexandre Belloni, linux-kernel, Ludovic Desroches, linux-crypto,
	David S . Miller, linux-arm-kernel

On Tue, Jul 23, 2019 at 03:19:36PM +0800, Chuhong Yuan wrote:
> Use devm_hwrng_register to get rid of manual
> unregistration.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/crypto/atmel-sha204a.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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-02  4:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  7:19 [PATCH] crypto: atmel-sha204a: Use device-managed registration API Chuhong Yuan
2019-07-23  7:19 ` Chuhong Yuan
2019-07-31 12:04 ` Ludovic Desroches
2019-07-31 12:04   ` Ludovic Desroches
2019-08-02  4:54 ` Herbert Xu
2019-08-02  4:54   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.