diff mbox

[tegrarcm,1/2] Remove the operational mode check

Message ID 1447089586-24826-2-git-send-email-alban.bedel@avionic-design.de
State Deferred
Delegated to: Stephen Warren
Headers show

Commit Message

Alban Bedel Nov. 9, 2015, 5:19 p.m. UTC
This check isn't really needed, if communication isn't possible it
will just fails later on. Further it currently prevent communicating
with secured devices, so just remove it.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
---
 src/main.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Stephen Warren Nov. 11, 2015, 5:07 p.m. UTC | #1
On 11/09/2015 10:19 AM, Alban Bedel wrote:
> This check isn't really needed, if communication isn't possible it
> will just fails later on. Further it currently prevent communicating
> with secured devices, so just remove it.

> diff --git a/src/main.c b/src/main.c

> @@ -352,13 +352,6 @@ int main(int argc, char **argv)

> -	if (info.op_mode != RCM_OP_MODE_DEVEL &&
> -	    info.op_mode != RCM_OP_MODE_ODM_OPEN &&
> -	    info.op_mode != RCM_OP_MODE_ODM_SECURE &&
> -	    info.op_mode != RCM_OP_MODE_PRE_PRODUCTION)
> -		error(1, ENODEV, "device is not in developer, open, secure, "
> -		      "or pre-production mode, cannot flash");

I would rather maintain the sanity check. The set of OP_MODE values 
should be quite small, so we should be able to simply add another on 
here. Recasting this as a switch might make the code marginally simpler.

Either way, we should update src/rcm.h to add a new RCM_OP_MODE 
constant, and dump_platform_info() so that it can print the name of the 
relevant other mode(s).
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/main.c b/src/main.c
index 3db0ed8..b024562 100644
--- a/src/main.c
+++ b/src/main.c
@@ -352,13 +352,6 @@  int main(int argc, char **argv)
 		error(1, errno, "wait status after platform info");
 	dump_platform_info(&info);
 
-	if (info.op_mode != RCM_OP_MODE_DEVEL &&
-	    info.op_mode != RCM_OP_MODE_ODM_OPEN &&
-	    info.op_mode != RCM_OP_MODE_ODM_SECURE &&
-	    info.op_mode != RCM_OP_MODE_PRE_PRODUCTION)
-		error(1, ENODEV, "device is not in developer, open, secure, "
-		      "or pre-production mode, cannot flash");
-
 	// download the BCT
 	ret = download_bct(h3p, bctfile);
 	if (ret) {