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>
This commit is contained in:
parent
b71685e1f4
commit
bf84eeb078
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue