linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: cmo@melexis.com
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Crt Mori <cmo@melexis.com>
Subject: [PATCH v6 3/3] iio: temperature: mlx90632 Change return value of sensor measurement channel
Date: Thu, 22 Sep 2022 10:13:24 +0200	[thread overview]
Message-ID: <565d4df2592d751dc0f40908f2569b7c9af8e56e.1663834141.git.cmo@melexis.com> (raw)
In-Reply-To: <cover.1663834141.git.cmo@melexis.com>

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>
---
 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 081803940261..224db7513baa 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;
-- 
2.34.1


  parent reply	other threads:[~2022-09-22  8:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  8:13 [PATCH v6 0/3] iio: temperature: mlx90632: Add powermanagement cmo
2022-09-22  8:13 ` [PATCH v6 1/3] iio: temperature: mlx90632 Add runtime powermanagement modes cmo
2022-10-02 16:09   ` Christophe JAILLET
2022-10-02 16:11     ` Christophe JAILLET
2022-10-02 16:11       ` Christophe JAILLET
2022-10-03  7:43       ` Andy Shevchenko
2022-10-03  8:20     ` Crt Mori
2022-10-09 16:36       ` Jonathan Cameron
2022-09-22  8:13 ` [PATCH v6 2/3] iio: temperature: mlx90632 Read sampling frequency cmo
2022-09-22  8:13 ` cmo [this message]
2022-09-24 16:32 ` [PATCH v6 0/3] iio: temperature: mlx90632: Add powermanagement Jonathan Cameron
2022-09-26 13:20   ` Crt Mori
2022-10-02 11:25     ` Jonathan Cameron
2022-10-02 14:36       ` Crt Mori
2022-10-02 14:43         ` Jonathan Cameron

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=565d4df2592d751dc0f40908f2569b7c9af8e56e.1663834141.git.cmo@melexis.com \
    --to=cmo@melexis.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --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 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).