Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joo Aun Saw and committed by
Jonathan Cameron
7868dfd2 1e9676a8

+2 -2
+2 -2
tools/iio/iio_utils.c
··· 487 487 device_dir, 488 488 current->name, 489 489 current->generic_name); 490 - if (ret < 0) 490 + if ((ret < 0) && (ret != -ENOENT)) 491 491 goto error_cleanup_array; 492 492 493 493 ret = iioutils_get_param_float(&current->offset, ··· 495 495 device_dir, 496 496 current->name, 497 497 current->generic_name); 498 - if (ret < 0) 498 + if ((ret < 0) && (ret != -ENOENT)) 499 499 goto error_cleanup_array; 500 500 501 501 ret = iioutils_get_type(&current->is_signed,