summaryrefslogtreecommitdiffstats
path: root/tools/iio
diff options
context:
space:
mode:
authorJoo Aun Saw <jasaw@dius.com.au>2015-07-23 12:53:47 +1000
committerJonathan Cameron <jic23@kernel.org>2015-07-23 20:45:50 +0100
commit7868dfd216074fc5f902e7befacda2a0ec76e403 (patch)
treef3665bc22d03de52a68bc5db51f79eccd71f1cc8 /tools/iio
parent1e9676a8474b657b6a793f0abff2205783a1ce6f (diff)
downloadop-kernel-dev-7868dfd216074fc5f902e7befacda2a0ec76e403.zip
op-kernel-dev-7868dfd216074fc5f902e7befacda2a0ec76e403.tar.gz
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 <jasaw@dius.com.au> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio')
-rw-r--r--tools/iio/iio_utils.c4
1 files changed, 2 insertions, 2 deletions
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(&current->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(&current->is_signed,
OpenPOWER on IntegriCloud