[PATCH v3 1/8] dm: rng: Add random number generator(rng) uclass
Sughosh Ganu
sughosh.ganu at linaro.org
Mon Dec 16 19:55:14 CET 2019
hi Patrick,
On Mon, 16 Dec 2019 at 17:43, Patrick DELAUNAY <patrick.delaunay at st.com>
wrote:
> Hi,
>
> > From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Sughosh Ganu
> > Sent: vendredi 13 décembre 2019 08:14
> >
> > Add a uclass for reading a random number seed from a random number
> generator
> > device.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > Reviewed-by: Patrice Chotard <patrice.chotard at st.com>
> > ---
> > drivers/Kconfig | 2 ++
> > drivers/Makefile | 1 +
> > drivers/rng/Kconfig | 7 +++++++
> > drivers/rng/Makefile | 6 ++++++
> > drivers/rng/rng-uclass.c | 23 +++++++++++++++++++++++
> > include/dm/uclass-id.h | 1 +
> > include/rng.h | 30 ++++++++++++++++++++++++++++++
> > 7 files changed, 70 insertions(+)
> > create mode 100644 drivers/rng/Kconfig
> > create mode 100644 drivers/rng/Makefile create mode 100644
> drivers/rng/rng-
> > uclass.c create mode 100644 include/rng.h
>
<snip>
> > diff --git a/include/rng.h b/include/rng.h new file mode 100644 index
> > 0000000..61d5da9
> > --- /dev/null
> > +++ b/include/rng.h
> > @@ -0,0 +1,30 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (c) 2019, Linaro Limited
> > + */
> > +
> > +#if !defined _RNG_H_
> > +#define _RNG_H_
> > +
> > +#include <dm.h>
> > +
> > +/**
> > + * dm_rng_read() - read a random number seed from the rng device
> > + * @buffer: input buffer to put the read random seed into
> > + * @size: number of bytes of random seed read
>
> Missing return value here, I propose:
>
> @return zero on success, or -ve error code.
>
Ok. Will add.
>
> > + *
> > + */
> > +int dm_rng_read(struct udevice *dev, void *buffer, size_t size);
> > +
> > +/* struct dm_rng_ops - Operations for the hwrng uclass */ struct
> > +dm_rng_ops {
> > + /**
> > + * @read() - read a random number seed
> > + *
> > + * @data: input buffer to read the random seed
> > + * @max: total number of bytes to read
>
> Missing return value here, I propose:
>
> @return zero on success, or -ve error code.
>
Ok. Will add.
-sughosh
More information about the U-Boot
mailing list