All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: iio-utils: use channel modifier scaling if it exists
@ 2016-07-31  5:11 Matt Ranostay
  2016-08-17  4:01 ` Matt Ranostay
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Ranostay @ 2016-07-31  5:11 UTC (permalink / raw)
  To: linux-iio; +Cc: Matt Ranostay, Marek Vasut, Jonathan Cameron

Now there are channel modifiers with their own scaling those should be
used when possible over the generic channel type scaling.

Cc: Marek Vasut <marex@denx.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
 tools/iio/iio_utils.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index 5eb6793f3972..7a6d61c6c012 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -121,10 +121,6 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
 
 	ret = -ENOENT;
 	while (ent = readdir(dp), ent)
-		/*
-		 * Do we allow devices to override a generic name with
-		 * a specific one?
-		 */
 		if ((strcmp(builtname, ent->d_name) == 0) ||
 		    (strcmp(builtname_generic, ent->d_name) == 0)) {
 			ret = asprintf(&filename,
@@ -178,6 +174,13 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
 			sysfsfp = 0;
 			free(filename);
 			filename = 0;
+
+			/*
+			 * Avoid having a more generic entry overwriting
+			 * the settings.
+			 */
+			if (strcmp(builtname, ent->d_name) == 0)
+				break;
 		}
 
 error_close_sysfsfp:
-- 
2.7.4


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

* Re: [PATCH] iio: iio-utils: use channel modifier scaling if it exists
  2016-07-31  5:11 [PATCH] iio: iio-utils: use channel modifier scaling if it exists Matt Ranostay
@ 2016-08-17  4:01 ` Matt Ranostay
  2016-08-21 10:53   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Ranostay @ 2016-08-17  4:01 UTC (permalink / raw)
  To: linux-iio; +Cc: Matt Ranostay, Marek Vasut, Jonathan Cameron

On Sat, Jul 30, 2016 at 10:11 PM, Matt Ranostay <mranostay@gmail.com> wrote:
> Now there are channel modifiers with their own scaling those should be
> used when possible over the generic channel type scaling.
>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Matt Ranostay <mranostay@gmail.com>

Jonathan,

Know you are probably still digging out your inbox since your holiday.
Any comments on this one?

Thanks,

Matt

> ---
>  tools/iio/iio_utils.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
> index 5eb6793f3972..7a6d61c6c012 100644
> --- a/tools/iio/iio_utils.c
> +++ b/tools/iio/iio_utils.c
> @@ -121,10 +121,6 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
>
>         ret = -ENOENT;
>         while (ent = readdir(dp), ent)
> -               /*
> -                * Do we allow devices to override a generic name with
> -                * a specific one?
> -                */
>                 if ((strcmp(builtname, ent->d_name) == 0) ||
>                     (strcmp(builtname_generic, ent->d_name) == 0)) {
>                         ret = asprintf(&filename,
> @@ -178,6 +174,13 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
>                         sysfsfp = 0;
>                         free(filename);
>                         filename = 0;
> +
> +                       /*
> +                        * Avoid having a more generic entry overwriting
> +                        * the settings.
> +                        */
> +                       if (strcmp(builtname, ent->d_name) == 0)
> +                               break;
>                 }
>
>  error_close_sysfsfp:
> --
> 2.7.4
>

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

* Re: [PATCH] iio: iio-utils: use channel modifier scaling if it exists
  2016-08-17  4:01 ` Matt Ranostay
@ 2016-08-21 10:53   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2016-08-21 10:53 UTC (permalink / raw)
  To: Matt Ranostay, linux-iio; +Cc: Marek Vasut

On 17/08/16 05:01, Matt Ranostay wrote:
> On Sat, Jul 30, 2016 at 10:11 PM, Matt Ranostay <mranostay@gmail.com> wrote:
>> Now there are channel modifiers with their own scaling those should be
>> used when possible over the generic channel type scaling.
>>
>> Cc: Marek Vasut <marex@denx.de>
>> Cc: Jonathan Cameron <jic23@kernel.org>
>> Signed-off-by: Matt Ranostay <mranostay@gmail.com>
> 
> Jonathan,
> 
> Know you are probably still digging out your inbox since your holiday.
> Any comments on this one?
> 
Indeed - still not caught up.  Was hoping for space on the plane,
but of course despite it being the middle of the day the person
in front of me immediately put their chair fully back. Laptop too
big to fit at that point!

Jonathan
> Thanks,
> 
> Matt
> 
>> ---
>>  tools/iio/iio_utils.c | 11 +++++++----
>>  1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
>> index 5eb6793f3972..7a6d61c6c012 100644
>> --- a/tools/iio/iio_utils.c
>> +++ b/tools/iio/iio_utils.c
>> @@ -121,10 +121,6 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
>>
>>         ret = -ENOENT;
>>         while (ent = readdir(dp), ent)
>> -               /*
>> -                * Do we allow devices to override a generic name with
>> -                * a specific one?
>> -                */
>>                 if ((strcmp(builtname, ent->d_name) == 0) ||
>>                     (strcmp(builtname_generic, ent->d_name) == 0)) {
>>                         ret = asprintf(&filename,
>> @@ -178,6 +174,13 @@ int iioutils_get_type(unsigned *is_signed, unsigned *bytes, unsigned *bits_used,
>>                         sysfsfp = 0;
>>                         free(filename);
>>                         filename = 0;
>> +
>> +                       /*
>> +                        * Avoid having a more generic entry overwriting
>> +                        * the settings.
>> +                        */
>> +                       if (strcmp(builtname, ent->d_name) == 0)
>> +                               break;
>>                 }
>>
>>  error_close_sysfsfp:
>> --
>> 2.7.4
>>


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

end of thread, other threads:[~2016-08-21 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-31  5:11 [PATCH] iio: iio-utils: use channel modifier scaling if it exists Matt Ranostay
2016-08-17  4:01 ` Matt Ranostay
2016-08-21 10:53   ` 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.