Commit 7868dfd2 authored by Joo Aun Saw's avatar Joo Aun Saw Committed by Jonathan Cameron

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: default avatarJoo Aun Saw <jasaw@dius.com.au>
Acked-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 1e9676a8
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment