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>
This commit is contained in:
Joo Aun Saw 2015-07-23 12:53:47 +10:00 committed by Jonathan Cameron
parent 1e9676a847
commit 7868dfd216

View File

@ -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,