[PATCH 1/3] hwrng: atmel - Add a local variable for struct device pointer
Herbert Xu
herbert at gondor.apana.org.au
Thu Apr 10 00:42:53 PDT 2025
On Thu, Apr 10, 2025 at 10:06:21AM +0300, Sakari Ailus wrote:
> Add a local variable for a struct device pointer instead of obtaining the
> hwrng priv field and casting it as a struct device pointer whenever it's
> needed.
>
> Signed-off-by: Sakari Ailus <sakari.ailus at linux.intel.com>
> ---
> drivers/char/hw_random/atmel-rng.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
> index 143406bc6939..5192c39ebaeb 100644
> --- a/drivers/char/hw_random/atmel-rng.c
> +++ b/drivers/char/hw_random/atmel-rng.c
> @@ -56,12 +56,13 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
> bool wait)
> {
> struct atmel_trng *trng = container_of(rng, struct atmel_trng, rng);
> + struct device *dev = (struct device *)trng->rng.priv;
Please stop using the priv field and instead add a struct device
pointer to struct atmel_trng.
Thanks,
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the Linux-mediatek
mailing list