mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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:
parent
1e9676a847
commit
7868dfd216
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user