All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: iio: make scale and offset files optional
@ 2015-07-23  2:53 Joo Aun Saw
  2015-07-23 19:28 ` Hartmut Knaack
  0 siblings, 1 reply; 3+ messages in thread
From: Joo Aun Saw @ 2015-07-23  2:53 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, knaack.h, Joo Aun Saw

From: Joo Aun Saw <jasaw@dius.com.au>

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>
---
 tools/iio/iio_utils.c | 4 ++--
 1 file 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,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-23 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23  2:53 [PATCH] tools: iio: make scale and offset files optional Joo Aun Saw
2015-07-23 19:28 ` Hartmut Knaack
2015-07-23 19:46   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.