All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: cmo@melexis.com
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2 3/3] iio: temperature: mlx90632 Change return value of sensor measurement channel
Date: Sun, 4 Sep 2022 15:49:23 +0100	[thread overview]
Message-ID: <20220904154923.33b79d83@jic23-huawei> (raw)
In-Reply-To: <20220903222422.3426156-1-cmo@melexis.com>

On Sun,  4 Sep 2022 00:24:22 +0200
cmo@melexis.com wrote:

> From: Crt Mori <cmo@melexis.com>
> 
> The current EINVAL value is more applicable to embedded library, where
> user can actually put the fixed value to the sensor. In case of the
> driver if the value of the channel is invalid it is better in inform
> userspace that Channel was out of range as that implies more to internal
> driver error than invalid input. It also makes for easier debugging of
> where the error comes from during the development.
> 
> Signed-off-by: Crt Mori <cmo@melexis.com>
Hmm. That's an obscure return value - I think it's mostly going to confuse
anyone who ever gets it.  So not sure this change is wise even though the
descriptive text for that one does seem very much suited to this usecase.

> ---
>  drivers/iio/temperature/mlx90632.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
> index 37edd324d6a1..d511d36942d3 100644
> --- a/drivers/iio/temperature/mlx90632.c
> +++ b/drivers/iio/temperature/mlx90632.c
> @@ -435,7 +435,7 @@ static int mlx90632_channel_new_select(int perform_ret, uint8_t *channel_new,
>  		*channel_old = 1;
>  		break;
>  	default:
> -		return -EINVAL;
> +		return -ECHRNG;
>  	}
>  
>  	return 0;


  reply	other threads:[~2022-09-04 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03 22:24 [PATCH v2 3/3] iio: temperature: mlx90632 Change return value of sensor measurement channel cmo
2022-09-04 14:49 ` Jonathan Cameron [this message]
2022-09-04 15:27   ` Crt Mori
2022-09-04 15:56     ` Jonathan Cameron
2022-09-04 19:19       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220904154923.33b79d83@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=cmo@melexis.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.