iio: generic_buffer: Fix --trigger-num option
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Fri, 3 Jun 2016 18:56:29 +0000 (21:56 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sat, 11 Jun 2016 16:38:06 +0000 (17:38 +0100)
commitdeb4d1fdcb5af079896f7ca5e8067e69485f6bdd
tree541c9af8d3750d8b82637dc56715012311c5657f
parentb9155073ff5de8ca6f1c40b64abca702a237c4d1
iio: generic_buffer: Fix --trigger-num option

Initialize trig_num to -1 and handle trig_num=0 as a valid id.

Fixes: 7c7e9dad (iio: iio_generic_buffer: Add --trigger-num option)
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
tools/iio/iio_generic_buffer.c