2023-07-13 07:11:10

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 0/3] hwrng: ba431 - trivial cleanups

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



2023-07-13 07:11:17

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 1/3] hwrng: ba431 - do not set drvdata

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

Signed-off-by: Martin Kaiser <[email protected]>
---
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


2023-07-13 07:11:17

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data

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 <[email protected]>
---
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


2023-07-22 02:23:37

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/3] hwrng: ba431 - trivial cleanups

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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt