From 7868dfd216074fc5f902e7befacda2a0ec76e403 Mon Sep 17 00:00:00 2001 From: Joo Aun Saw Date: Thu, 23 Jul 2015 12:53:47 +1000 Subject: tools: iio: make scale and offset files optional Make scale and offset optional by adding -ENOENT check as not all drivers implement them. Signed-off-by: Joo Aun Saw Acked-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- tools/iio/iio_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/iio') diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c index c3f9e37..1dcdf03 100644 --- a/tools/iio/iio_utils.c +++ b/tools/iio/iio_utils.c @@ -487,7 +487,7 @@ int build_channel_array(const char *device_dir, device_dir, current->name, current->generic_name); - if (ret < 0) + if ((ret < 0) && (ret != -ENOENT)) goto error_cleanup_array; ret = iioutils_get_param_float(¤t->offset, @@ -495,7 +495,7 @@ int build_channel_array(const char *device_dir, device_dir, current->name, current->generic_name); - if (ret < 0) + if ((ret < 0) && (ret != -ENOENT)) goto error_cleanup_array; ret = iioutils_get_type(¤t->is_signed, -- cgit v1.1