Skip to contentSkip to conversation

imx: ahab: allow to bypass confirmation for ahab_close cmd

PATCH Superseded Clément Péron 1 participant 1 message Dec 21, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx: ahab: allow to bypass confirmation for ahab_close cmd

Calling ahab_close cmd for the user to interact for confirmation.

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

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

---
 arch/arm/mach-imx/imx8/ahab.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-imx/imx8/ahab.c +2 -1
index cf3c7d762a74..b0865c2330a2 100644
@@ -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);
Signature · 1 line
2.25.1