summaryrefslogtreecommitdiffstats
path: root/commands/flash.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-10-12 09:27:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-10-12 09:27:47 +0200
commitbf84eeb078721019dbab81a26170c53388256a1d (patch)
treed9e878c891bee6b35c559f5da22ab299b66bc767 /commands/flash.c
parentb71685e1f415e50c7a462bb3049187d082aa09e3 (diff)
downloadbarebox-bf84eeb078721019dbab81a26170c53388256a1d.tar.gz
barebox-bf84eeb078721019dbab81a26170c53388256a1d.tar.xz
protect command: ignore -ENOSYS
Return success on -ENOSYS. (un)protecting a device which is not protectable should not irritate users. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/flash.c')
-rw-r--r--commands/flash.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/flash.c b/commands/flash.c
index ac81b31c79..c0c6e12ad1 100644
--- a/commands/flash.c
+++ b/commands/flash.c
@@ -117,7 +117,7 @@ static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
struct stat s;
int prot = 1;
unsigned long start = 0, size = ~0;
- int ret = 0;
+ int ret = 0, err;
if (argc == 1) {
u_boot_cmd_usage(cmdtp);
@@ -154,7 +154,8 @@ static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
goto out;
}
- if(protect(fd, size, start, prot)) {
+ err = protect(fd, size, start, prot);
+ if (err && err != -ENOSYS) {
perror("protect");
ret = 1;
goto out;