diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-23 08:38:29 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-06-23 08:38:31 +0200 |
commit | 54d78652c19cda7256fd5a086e806ef0b5fe32bc (patch) | |
tree | 5fd5f3e64b4815a4041329db441859fbc52cf9cc | |
parent | cd09bf8f515c014fcceffaf2aeb8ed434dd527f2 (diff) | |
download | barebox-54d78652c19cda7256fd5a086e806ef0b5fe32bc.tar.gz barebox-54d78652c19cda7256fd5a086e806ef0b5fe32bc.tar.xz |
devinfo: fix return value
devinfo on a non existing device prints:
no such device: blah
devinfo: Operation not permitted
The second message comes because devinfo returns -1 which is -EPERM.
Just return -ENODEV which will print:
devinfo: No such device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | commands/devinfo.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/commands/devinfo.c b/commands/devinfo.c index e61aaa24e8..3c9d6a6b9d 100644 --- a/commands/devinfo.c +++ b/commands/devinfo.c @@ -68,11 +68,8 @@ static int do_devinfo(int argc, char *argv[]) } } else { dev = get_device_by_name(argv[1]); - - if (!dev) { - printf("no such device: %s\n",argv[1]); - return -1; - } + if (!dev) + return -ENODEV; if (dev->num_resources) printf("Resources:\n"); |