Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2131328rwb; Sun, 4 Sep 2022 09:00:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR76AwxG/iugBeHsrcbgdsPwDi/bWv2DmSvtAJW/8oOz+R7HINyaUs6jNcxFvTh+Di08vnkL X-Received: by 2002:a17:902:7003:b0:172:cbb0:9af8 with SMTP id y3-20020a170902700300b00172cbb09af8mr45771318plk.57.1662307229367; Sun, 04 Sep 2022 09:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662307229; cv=none; d=google.com; s=arc-20160816; b=r7+hrrhKopU9lV4A9/z/INBAQ/gHVVeO9wcyigyDltvzfaPn8YHxjB9SeR/P53rV6J ELiDjOJtWP2c8qRYAG45tjoMH1kL4Y0CBtc0duhrKwbsdJ5BFI2Fqp5QEmKJTXWbNj1i KMyldc6V+cbLzZOGajFvcOwVTF4Mm1IDybfWORrT40rvhoqO5wswVHzrFSubvYCiRVXs pEGsF2/K2PSdHTxe2EXyFCsGI85Mb8sd0/qNcsSswTgBeheEGXPPi915s4j8eiCgQj8I ODTGRFFJrDGd1OCeNBLbUnudxQZouzUTSK7I+fB3L91p4OWpryTQEyp55SgoPavuXd29 XHdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Dl3oo0+ZPdPs0uvjM47dbTjP7rsRbgB9/YN+RUeReZs=; b=oXQWqABtakLOcoWD/6vZUVdtApgFGfnwAmLotGijnE3LcOqJZObuVcRn3Bx3olXHv/ s5FnSmgm1Z5WYtAb/ut7xnb7lVJ9DnAbqOqeJIWE9hzzPPRk1zVjjFKzGoY4hEPL6RGM THzT4zeOfK41NnkNTbe4gI+8l8nfq529uV6fmjeUVPmw4xHcScP5o9V3/pRuYih9kngN g4TEvk53jap3WzOBCuwdktmHPGvnBZP5NkH6QZbIsymgyclBsxNXAoIxsFNVxSSBlyHf 2Cm/m7GiUDq8xheh+yuI5XP8Rk1P7ZBOZzP79uooir9Biwwp2NDho5Om9segxA4zY3pA t57g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pl/O16D0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk14-20020a17090b224e00b0020051123147si2025892pjb.34.2022.09.04.09.00.17; Sun, 04 Sep 2022 09:00:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pl/O16D0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbiIDPXk (ORCPT + 99 others); Sun, 4 Sep 2022 11:23:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiIDPXe (ORCPT ); Sun, 4 Sep 2022 11:23:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BBB33120D; Sun, 4 Sep 2022 08:23:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 26041B80D90; Sun, 4 Sep 2022 15:23:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC91FC433D7; Sun, 4 Sep 2022 15:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662305010; bh=C5+6BktQ0c4QwzHvwj8UwuDHzj81uEju9cMeYCIBLGw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pl/O16D0YiUI+aTtoIUhXPDXONd8yTKQKJDMfs5wAUFOaTnCO5+g9IOI9igtJzJb0 okDaaHsZsSI8idQ9kTC0Ei1KlM1RnklP5XHYFsHhJ2lmW9jd9BLjGqn58hEBybUZZN LB5QFKLEGy8PUEJSytpdGEFkm3P8wLNZaN1s1wBQ417RMhJECczQNCztlXBR0FnpfV YXDLFELcj22M5HMfNekI2vQUdqkioZLub+7i0qJwpKY4JjeX74UV8QAiKc5MTEjz10 NHS/96VXEZGm6J0olpbpCNQ3hA0iIMgHX2BVk4GPSAoKvmeH69CHtAE047R7E7fSa8 zdjkeNrTlgu7w== Date: Sun, 4 Sep 2022 15:49:23 +0100 From: Jonathan Cameron To: cmo@melexis.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH v2 3/3] iio: temperature: mlx90632 Change return value of sensor measurement channel Message-ID: <20220904154923.33b79d83@jic23-huawei> In-Reply-To: <20220903222422.3426156-1-cmo@melexis.com> References: <20220903222422.3426156-1-cmo@melexis.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 4 Sep 2022 00:24:22 +0200 cmo@melexis.com wrote: > From: Crt Mori > > 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 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;