Commit e83a47cf authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron

tools:iio:generic_buffer: pass up right error code

find_type_by_name() returns a valid error code in case of an error. Pass
this code up instead of an artificial one.
Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 8749948a
...@@ -202,7 +202,7 @@ int main(int argc, char **argv) ...@@ -202,7 +202,7 @@ int main(int argc, char **argv)
dev_num = find_type_by_name(device_name, "iio:device"); dev_num = find_type_by_name(device_name, "iio:device");
if (dev_num < 0) { if (dev_num < 0) {
printf("Failed to find the %s\n", device_name); printf("Failed to find the %s\n", device_name);
ret = -ENODEV; ret = dev_num;
goto error_ret; goto error_ret;
} }
printf("iio device number being used is %d\n", dev_num); printf("iio device number being used is %d\n", dev_num);
...@@ -228,7 +228,7 @@ int main(int argc, char **argv) ...@@ -228,7 +228,7 @@ int main(int argc, char **argv)
trig_num = find_type_by_name(trigger_name, "trigger"); trig_num = find_type_by_name(trigger_name, "trigger");
if (trig_num < 0) { if (trig_num < 0) {
printf("Failed to find the trigger %s\n", trigger_name); printf("Failed to find the trigger %s\n", trigger_name);
ret = -ENODEV; ret = trig_num;
goto error_free_triggername; goto error_free_triggername;
} }
printf("iio trigger number being used is %d\n", trig_num); printf("iio trigger number being used is %d\n", trig_num);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment