[PATCH 4/5] hwrng: meson: use struct hw_random priv data
Herbert Xu
herbert at gondor.apana.org.au
Sun Feb 19 20:41:55 PST 2023
On Sat, Feb 18, 2023 at 09:58:07PM +0100, Heiner Kallweit wrote:
> Use the priv data member of struct hwrng to make the iomem base address
> available in meson_rng_read(). This allows for removing struct
> meson_rng_data completely in the next step.
> __force is used to silence sparse warnings.
>
> Signed-off-by: Heiner Kallweit <hkallweit1 at gmail.com>
> ---
> drivers/char/hw_random/meson-rng.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c
> index a4eb8e35f..bf7a6e594 100644
> --- a/drivers/char/hw_random/meson-rng.c
> +++ b/drivers/char/hw_random/meson-rng.c
> @@ -17,16 +17,14 @@
> #define RNG_DATA 0x00
>
> struct meson_rng_data {
> - void __iomem *base;
> struct hwrng rng;
> };
This is too ugly for words. If you're trying to save memory we
should instead get rid of rng.priv and convert the drivers that
user it over to this model of embedding struct hwrng inside the
driver struct.
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-amlogic
mailing list