Skip to content

Commit f8e81d7

Browse files
grgbrjic23
authored andcommitted
tools:iio:iio_generic_buffer: fix trigger-less mode
Passing the trigger-less mode option on the command line causes iio_generic_buffer to fail searching for an IIO trigger. Fix this by skipping trigger initialization if trigger-less mode is requested. Technically it actually fixes: 7c7e9da where the bug was introduced but as the window to the patch below that changes the context was very small let's mark it with that. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Fixes: deb4d1f ("iio: generic_buffer: Fix --trigger-num option") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent eafe5cf commit f8e81d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/iio/iio_generic_buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ int main(int argc, char **argv)
456456

457457
if (notrigger) {
458458
printf("trigger-less mode selected\n");
459-
} if (trig_num >= 0) {
459+
} else if (trig_num >= 0) {
460460
char *trig_dev_name;
461461
ret = asprintf(&trig_dev_name, "%strigger%d", iio_dir, trig_num);
462462
if (ret < 0) {

0 commit comments

Comments
 (0)