diff mbox series

[1/2] drivers/rng: simplify Kconfig

Message ID 20200304011738.33763-2-xypron.glpk@gmx.de
State Accepted
Commit c312c4b4dcd0574b81ff2c0d543f42295305ffaa
Headers show
Series drivers/rng: add Amlogic hardware RNG driver | expand

Commit Message

Heinrich Schuchardt March 4, 2020, 1:17 a.m. UTC
For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can simply
set the default to yes.

All rng drivers depend on DM_RNG. Use a single 'if' instead of individual
dependencies. Now 'make menuconfig' shows the individual drivers neatly
indented under the DM_RNG entry.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 configs/sandbox64_defconfig | 1 -
 configs/sandbox_defconfig   | 1 -
 drivers/rng/Kconfig         | 9 +++++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

--
2.25.1

Comments

Patrick Delaunay March 5, 2020, 5:03 p.m. UTC | #1
Hi Heinrich,

> From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Heinrich Schuchardt
> Sent: mercredi 4 mars 2020 02:18
> 
> For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can
> simply set the default to yes.
> 
> All rng drivers depend on DM_RNG. Use a single 'if' instead of individual
> dependencies. Now 'make menuconfig' shows the individual drivers neatly
> indented under the DM_RNG entry.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---

Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com>

Regards
Patrick

>  configs/sandbox64_defconfig | 1 -
>  configs/sandbox_defconfig   | 1 -
>  drivers/rng/Kconfig         | 9 +++++++--
>  3 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index
> d1c94b65a1..71a4d7fccb 100644
> --- a/configs/sandbox64_defconfig
> +++ b/configs/sandbox64_defconfig
> @@ -169,7 +169,6 @@ CONFIG_REMOTEPROC_SANDBOX=y
> CONFIG_DM_RESET=y  CONFIG_SANDBOX_RESET=y  CONFIG_DM_RNG=y -
> CONFIG_RNG_SANDBOX=y  CONFIG_DM_RTC=y  CONFIG_RTC_RV8803=y
> CONFIG_SANDBOX_SERIAL=y diff --git a/configs/sandbox_defconfig
> b/configs/sandbox_defconfig index 45b5475b79..f96891ecae 100644
> --- a/configs/sandbox_defconfig
> +++ b/configs/sandbox_defconfig
> @@ -189,7 +189,6 @@ CONFIG_REMOTEPROC_SANDBOX=y
> CONFIG_DM_RESET=y  CONFIG_SANDBOX_RESET=y  CONFIG_DM_RNG=y -
> CONFIG_RNG_SANDBOX=y  CONFIG_DM_RTC=y  CONFIG_RTC_RV8803=y
> CONFIG_DEBUG_UART_SANDBOX=y diff --git a/drivers/rng/Kconfig
> b/drivers/rng/Kconfig index 893b89d49b..c1aa43b823 100644
> --- a/drivers/rng/Kconfig
> +++ b/drivers/rng/Kconfig
> @@ -6,16 +6,21 @@ config DM_RNG
>  	  This interface is used to initialise the rng device and to
>  	  read the random seed from the device.
> 
> +if DM_RNG
> +
>  config RNG_SANDBOX
>  	bool "Sandbox random number generator"
> -	depends on SANDBOX && DM_RNG
> +	depends on SANDBOX
> +	default y
>  	help
>  	  Enable random number generator for sandbox. This is an
>  	  emulation of a rng device.
> 
>  config RNG_STM32MP1
>  	bool "Enable random number generator for STM32MP1"
> -	depends on ARCH_STM32MP && DM_RNG
> +	depends on ARCH_STM32MP
>  	default n
>  	help
>  	  Enable STM32MP1 rng driver.
> +
> +endif
> --
> 2.25.1
Sughosh Ganu March 6, 2020, 11:45 a.m. UTC | #2
On Wed, 4 Mar 2020 at 06:47, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:

> For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can simply
> set the default to yes.
>
> All rng drivers depend on DM_RNG. Use a single 'if' instead of individual
> dependencies. Now 'make menuconfig' shows the individual drivers neatly
> indented under the DM_RNG entry.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>

Reviewed-by: Sughosh Ganu <sughosh.ganu at linaro.org>


-sughosh

 configs/sandbox64_defconfig | 1 -
>  configs/sandbox_defconfig   | 1 -
>  drivers/rng/Kconfig         | 9 +++++++--
>  3 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
> index d1c94b65a1..71a4d7fccb 100644
> --- a/configs/sandbox64_defconfig
> +++ b/configs/sandbox64_defconfig
> @@ -169,7 +169,6 @@ CONFIG_REMOTEPROC_SANDBOX=y
>  CONFIG_DM_RESET=y
>  CONFIG_SANDBOX_RESET=y
>  CONFIG_DM_RNG=y
> -CONFIG_RNG_SANDBOX=y
>  CONFIG_DM_RTC=y
>  CONFIG_RTC_RV8803=y
>  CONFIG_SANDBOX_SERIAL=y
> diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
> index 45b5475b79..f96891ecae 100644
> --- a/configs/sandbox_defconfig
> +++ b/configs/sandbox_defconfig
> @@ -189,7 +189,6 @@ CONFIG_REMOTEPROC_SANDBOX=y
>  CONFIG_DM_RESET=y
>  CONFIG_SANDBOX_RESET=y
>  CONFIG_DM_RNG=y
> -CONFIG_RNG_SANDBOX=y
>  CONFIG_DM_RTC=y
>  CONFIG_RTC_RV8803=y
>  CONFIG_DEBUG_UART_SANDBOX=y
> diff --git a/drivers/rng/Kconfig b/drivers/rng/Kconfig
> index 893b89d49b..c1aa43b823 100644
> --- a/drivers/rng/Kconfig
> +++ b/drivers/rng/Kconfig
> @@ -6,16 +6,21 @@ config DM_RNG
>           This interface is used to initialise the rng device and to
>           read the random seed from the device.
>
> +if DM_RNG
> +
>  config RNG_SANDBOX
>         bool "Sandbox random number generator"
> -       depends on SANDBOX && DM_RNG
> +       depends on SANDBOX
> +       default y
>         help
>           Enable random number generator for sandbox. This is an
>           emulation of a rng device.
>
>  config RNG_STM32MP1
>         bool "Enable random number generator for STM32MP1"
> -       depends on ARCH_STM32MP && DM_RNG
> +       depends on ARCH_STM32MP
>         default n
>         help
>           Enable STM32MP1 rng driver.
> +
> +endif
> --
> 2.25.1
>
>
Sughosh Ganu March 7, 2020, 6:58 a.m. UTC | #3
hi Tom,

On Wed, 4 Mar 2020 at 06:47, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:

> For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can simply
> set the default to yes.
>
> All rng drivers depend on DM_RNG. Use a single 'if' instead of individual
> dependencies. Now 'make menuconfig' shows the individual drivers neatly
> indented under the DM_RNG entry.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>

---
>

Can you please pick up the two patches of the series directly. Thanks.

-sughosh
Heinrich Schuchardt March 13, 2020, 7:08 a.m. UTC | #4
On 3/7/20 7:58 AM, Sughosh Ganu wrote:
> hi Tom,
>
> On Wed, 4 Mar 2020 at 06:47, Heinrich Schuchardt <xypron.glpk at gmx.de
> <mailto:xypron.glpk at gmx.de>> wrote:
>
>     For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can
>     simply
>     set the default to yes.
>
>     All rng drivers depend on DM_RNG. Use a single 'if' instead of
>     individual
>     dependencies. Now 'make menuconfig' shows the individual drivers neatly
>     indented under the DM_RNG entry.
>
>     Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de
>     <mailto:xypron.glpk at gmx.de>>
>
>     ---
>
>
> Can you please pick up the two patches of the series directly. Thanks.
>
> -sughosh

This series has been applied to origin/master (bc40eb278b0c14b990556ea).

Best regards

Heinrich
diff mbox series

Patch

diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
index d1c94b65a1..71a4d7fccb 100644
--- a/configs/sandbox64_defconfig
+++ b/configs/sandbox64_defconfig
@@ -169,7 +169,6 @@  CONFIG_REMOTEPROC_SANDBOX=y
 CONFIG_DM_RESET=y
 CONFIG_SANDBOX_RESET=y
 CONFIG_DM_RNG=y
-CONFIG_RNG_SANDBOX=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RV8803=y
 CONFIG_SANDBOX_SERIAL=y
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 45b5475b79..f96891ecae 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -189,7 +189,6 @@  CONFIG_REMOTEPROC_SANDBOX=y
 CONFIG_DM_RESET=y
 CONFIG_SANDBOX_RESET=y
 CONFIG_DM_RNG=y
-CONFIG_RNG_SANDBOX=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RV8803=y
 CONFIG_DEBUG_UART_SANDBOX=y
diff --git a/drivers/rng/Kconfig b/drivers/rng/Kconfig
index 893b89d49b..c1aa43b823 100644
--- a/drivers/rng/Kconfig
+++ b/drivers/rng/Kconfig
@@ -6,16 +6,21 @@  config DM_RNG
 	  This interface is used to initialise the rng device and to
 	  read the random seed from the device.

+if DM_RNG
+
 config RNG_SANDBOX
 	bool "Sandbox random number generator"
-	depends on SANDBOX && DM_RNG
+	depends on SANDBOX
+	default y
 	help
 	  Enable random number generator for sandbox. This is an
 	  emulation of a rng device.

 config RNG_STM32MP1
 	bool "Enable random number generator for STM32MP1"
-	depends on ARCH_STM32MP && DM_RNG
+	depends on ARCH_STM32MP
 	default n
 	help
 	  Enable STM32MP1 rng driver.
+
+endif