linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] hwrng: ba431 - trivial cleanups
@ 2023-07-13  7:04 Martin Kaiser
  2023-07-13  7:04 ` [PATCH 1/3] hwrng: ba431 - do not set drvdata Martin Kaiser
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Martin Kaiser @ 2023-07-13  7:04 UTC (permalink / raw)
  To: Herbert Xu
  Cc: olivier, linux-crypto, linux-arm-kernel, linux-kernel,
	Martin Kaiser

Here's three trivial clenaups of the ba431 driver. Compile-tested only.

Martin Kaiser (3):
  hwrng: ba431 - do not set drvdata
  hwrng: ba431 - don't init of_device_id's data
  hwrng: ba431 - use dev_err_probe after failed registration

 drivers/char/hw_random/ba431-rng.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

-- 
2.30.2


_______________________________________________
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] 5+ messages in thread

* [PATCH 1/3] hwrng: ba431 - do not set drvdata
  2023-07-13  7:04 [PATCH 0/3] hwrng: ba431 - trivial cleanups Martin Kaiser
@ 2023-07-13  7:04 ` Martin Kaiser
  2023-07-13  7:04 ` [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data Martin Kaiser
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Kaiser @ 2023-07-13  7:04 UTC (permalink / raw)
  To: Herbert Xu
  Cc: olivier, linux-crypto, linux-arm-kernel, linux-kernel,
	Martin Kaiser

Do not set drvdata in the ba431 driver. Nobody is using it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/ba431-rng.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index 5b7ca0416490..b1518dd52a24 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -189,8 +189,6 @@ static int ba431_trng_probe(struct platform_device *pdev)
 	ba431->rng.cleanup = ba431_trng_cleanup;
 	ba431->rng.read = ba431_trng_read;
 
-	platform_set_drvdata(pdev, ba431);
-
 	ret = devm_hwrng_register(&pdev->dev, &ba431->rng);
 	if (ret) {
 		dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret);
-- 
2.30.2


_______________________________________________
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] 5+ messages in thread

* [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data
  2023-07-13  7:04 [PATCH 0/3] hwrng: ba431 - trivial cleanups Martin Kaiser
  2023-07-13  7:04 ` [PATCH 1/3] hwrng: ba431 - do not set drvdata Martin Kaiser
@ 2023-07-13  7:04 ` Martin Kaiser
  2023-07-13  7:04 ` [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration Martin Kaiser
  2023-07-22  2:13 ` [PATCH 0/3] hwrng: ba431 - trivial cleanups Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Kaiser @ 2023-07-13  7:04 UTC (permalink / raw)
  To: Herbert Xu
  Cc: olivier, linux-crypto, linux-arm-kernel, linux-kernel,
	Martin Kaiser

We have no device-specific data for silex-insight,ba431-rng. There's no
need to set .data = NULL, this is the default.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/ba431-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index b1518dd52a24..d2a9d16323a6 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -201,7 +201,7 @@ static int ba431_trng_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id ba431_trng_dt_ids[] = {
-	{ .compatible = "silex-insight,ba431-rng", .data = NULL },
+	{ .compatible = "silex-insight,ba431-rng" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ba431_trng_dt_ids);
-- 
2.30.2


_______________________________________________
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] 5+ messages in thread

* [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration
  2023-07-13  7:04 [PATCH 0/3] hwrng: ba431 - trivial cleanups Martin Kaiser
  2023-07-13  7:04 ` [PATCH 1/3] hwrng: ba431 - do not set drvdata Martin Kaiser
  2023-07-13  7:04 ` [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data Martin Kaiser
@ 2023-07-13  7:04 ` Martin Kaiser
  2023-07-22  2:13 ` [PATCH 0/3] hwrng: ba431 - trivial cleanups Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Kaiser @ 2023-07-13  7:04 UTC (permalink / raw)
  To: Herbert Xu
  Cc: olivier, linux-crypto, linux-arm-kernel, linux-kernel,
	Martin Kaiser

Use dev_err_probe to print the error message after a failed hwrng
registration.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/char/hw_random/ba431-rng.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index d2a9d16323a6..9de7466e6896 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -190,10 +190,8 @@ static int ba431_trng_probe(struct platform_device *pdev)
 	ba431->rng.read = ba431_trng_read;
 
 	ret = devm_hwrng_register(&pdev->dev, &ba431->rng);
-	if (ret) {
-		dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "BA431 registration failed\n");
 
 	dev_info(&pdev->dev, "BA431 TRNG registered\n");
 
-- 
2.30.2


_______________________________________________
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] 5+ messages in thread

* Re: [PATCH 0/3] hwrng: ba431 - trivial cleanups
  2023-07-13  7:04 [PATCH 0/3] hwrng: ba431 - trivial cleanups Martin Kaiser
                   ` (2 preceding siblings ...)
  2023-07-13  7:04 ` [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration Martin Kaiser
@ 2023-07-22  2:13 ` Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2023-07-22  2:13 UTC (permalink / raw)
  To: Martin Kaiser; +Cc: olivier, linux-crypto, linux-arm-kernel, linux-kernel

On Thu, Jul 13, 2023 at 09:04:43AM +0200, Martin Kaiser wrote:
> Here's three trivial clenaups of the ba431 driver. Compile-tested only.
> 
> Martin Kaiser (3):
>   hwrng: ba431 - do not set drvdata
>   hwrng: ba431 - don't init of_device_id's data
>   hwrng: ba431 - use dev_err_probe after failed registration
> 
>  drivers/char/hw_random/ba431-rng.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> -- 
> 2.30.2

All 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] 5+ messages in thread

end of thread, other threads:[~2023-07-22  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-13  7:04 [PATCH 0/3] hwrng: ba431 - trivial cleanups Martin Kaiser
2023-07-13  7:04 ` [PATCH 1/3] hwrng: ba431 - do not set drvdata Martin Kaiser
2023-07-13  7:04 ` [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data Martin Kaiser
2023-07-13  7:04 ` [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration Martin Kaiser
2023-07-22  2:13 ` [PATCH 0/3] hwrng: ba431 - trivial cleanups Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).