diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-03-24 04:39:14 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-04-03 05:27:49 -0400 |
commit | 793d6b5ea80c9bba8de40b720991b436fa5e174d (patch) | |
tree | 044c625ff287e2935f31329812f0a4827b1d0bd0 | |
parent | fb12b6c725a3936bedaa7fac87432f0ad0d01599 (diff) |
iio: tools: make generic_buffer look for "-trigger"
All the ST Sensors use the old "<foo>-trigger" rather than the
standard "<foo>-devN" new standard suffix for triggers. Now much
to do about it since it is ABI, but make the testing tools
recognize it too.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | tools/iio/generic_buffer.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 01c4f67801e0..c42b7f836b48 100644 --- a/tools/iio/generic_buffer.c +++ b/tools/iio/generic_buffer.c | |||
@@ -304,7 +304,19 @@ int main(int argc, char **argv) | |||
304 | } | 304 | } |
305 | } | 305 | } |
306 | 306 | ||
307 | /* Verify the trigger exists */ | 307 | /* Look for this "-devN" trigger */ |
308 | trig_num = find_type_by_name(trigger_name, "trigger"); | ||
309 | if (trig_num < 0) { | ||
310 | /* OK try the simpler "-trigger" suffix instead */ | ||
311 | free(trigger_name); | ||
312 | ret = asprintf(&trigger_name, | ||
313 | "%s-trigger", device_name); | ||
314 | if (ret < 0) { | ||
315 | ret = -ENOMEM; | ||
316 | goto error_free_dev_dir_name; | ||
317 | } | ||
318 | } | ||
319 | |||
308 | trig_num = find_type_by_name(trigger_name, "trigger"); | 320 | trig_num = find_type_by_name(trigger_name, "trigger"); |
309 | if (trig_num < 0) { | 321 | if (trig_num < 0) { |
310 | fprintf(stderr, "Failed to find the trigger %s\n", | 322 | fprintf(stderr, "Failed to find the trigger %s\n", |