linux-iio.vger.kernel.org archive mirror
 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

* Re: [PATCH] tools: iio: make scale and offset files optional
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Knaack @ 2015-07-23 19:28 UTC (permalink / raw)
  To: Joo Aun Saw, linux-iio; +Cc: jic23

Joo Aun Saw schrieb am 23.07.2015 um 04:53:
> 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>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
> ---
>  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,
> 

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

* Re: [PATCH] tools: iio: make scale and offset files optional
  2015-07-23 19:28 ` Hartmut Knaack
@ 2015-07-23 19:46   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2015-07-23 19:46 UTC (permalink / raw)
  To: Hartmut Knaack, Joo Aun Saw, linux-iio

On 23/07/15 20:28, Hartmut Knaack wrote:
> Joo Aun Saw schrieb am 23.07.2015 um 04:53:
>> 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>
> Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Thanks.  Applied to the togreg branch of iio.git - initially
pushed out as testing (in this case to be completely ignored
- I think - but there we are ;)

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


^ permalink raw reply	[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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).