diff mbox series

[v2] imx: ahab: allow to bypass confirmation for ahab_close cmd

Message ID 20201221173128.354567-1-peron.clem@gmail.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series [v2] imx: ahab: allow to bypass confirmation for ahab_close cmd | expand

Commit Message

Clément Péron Dec. 21, 2020, 5:31 p.m. UTC
Calling ahab_close cmd force the user to interact for confirmation.

This is not user-friendly when using this cmd during factory process.

Allow the user to pass '-y' option to bypass this confirmation.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
v2:
  - Fix commit log

---
 arch/arm/mach-imx/imx8/ahab.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Peng Fan Dec. 22, 2020, 1:55 a.m. UTC | #1
> Subject: [PATCH v2] imx: ahab: allow to bypass confirmation for ahab_close
> cmd
> 
> Calling ahab_close cmd force the user to interact for confirmation.
> 
> This is not user-friendly when using this cmd during factory process.
> 
> Allow the user to pass '-y' option to bypass this confirmation.
> 
> Signed-off-by: Clément Péron <peron.clem@gmail.com>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> ---
> v2:
>   - Fix commit log
> 
> ---
>  arch/arm/mach-imx/imx8/ahab.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/imx8/ahab.c
> b/arch/arm/mach-imx/imx8/ahab.c index cf3c7d762a74..b0865c2330a2
> 100644
> --- a/arch/arm/mach-imx/imx8/ahab.c
> +++ b/arch/arm/mach-imx/imx8/ahab.c
> @@ -301,10 +301,11 @@ static int confirm_close(void)  static int
> do_ahab_close(cmd_tbl_t *cmdtp, int flag, int argc,
>  			 char * const argv[])
>  {
> +	int confirmed = argc >= 2 && !strcmp(argv[1], "-y");
>  	int err;
>  	u16 lc;
> 
> -	if (!confirm_close())
> +	if (!confirmed && !confirm_close())
>  		return -EACCES;
> 
>  	err = sc_seco_chip_info(-1, &lc, NULL, NULL, NULL);
> --
> 2.25.1
Oliver Graute Dec. 23, 2020, 1:18 p.m. UTC | #2
On 21/12/20, Clément Péron wrote:
> Calling ahab_close cmd force the user to interact for confirmation.
> 
> This is not user-friendly when using this cmd during factory process.
> 
> Allow the user to pass '-y' option to bypass this confirmation.
> 
> Signed-off-by: Clément Péron <peron.clem@gmail.com>
Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
Stefano Babic Dec. 26, 2020, 3:53 p.m. UTC | #3
> Calling ahab_close cmd force the user to interact for confirmation.
> This is not user-friendly when using this cmd during factory process.
> Allow the user to pass '-y' option to bypass this confirmation.
> Signed-off-by: Clément Péron <peron.clem@gmail.com>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c
index cf3c7d762a74..b0865c2330a2 100644
--- a/arch/arm/mach-imx/imx8/ahab.c
+++ b/arch/arm/mach-imx/imx8/ahab.c
@@ -301,10 +301,11 @@  static int confirm_close(void)
 static int do_ahab_close(cmd_tbl_t *cmdtp, int flag, int argc,
 			 char * const argv[])
 {
+	int confirmed = argc >= 2 && !strcmp(argv[1], "-y");
 	int err;
 	u16 lc;
 
-	if (!confirm_close())
+	if (!confirmed && !confirm_close())
 		return -EACCES;
 
 	err = sc_seco_chip_info(-1, &lc, NULL, NULL, NULL);