Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2477798rdh; Sun, 29 Oct 2023 19:10:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFQFLIBrW4//tYtacV+aO9r67LU5zpkI9xta8Zph7bWjKF4lX3loXptxLkxG3mf+gfJANI X-Received: by 2002:a1f:f80f:0:b0:493:49ef:59e0 with SMTP id w15-20020a1ff80f000000b0049349ef59e0mr7573211vkh.13.1698631836893; Sun, 29 Oct 2023 19:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698631836; cv=none; d=google.com; s=arc-20160816; b=M9+sR22JGk1YqRvLuwf0/Wiu+FBcN6Y2rMq5c44vp+dVrd8CBazG8qwdbY45aW2FeH +I6oBdnt0bSWnj/kvcRaEfuxxvQNXN035R/eT/G2nEE/LKHFj7e6rVPRY6k7EbnsoH0F wLOSloVG2DLZNJFow81oJwHYr6v7nEtLeTogBo3giCbE471hNHj1fk4GqrjCD1VLnzaf z1mB2ruClS1hH60+VpkHnmk42pBmFIWhC4jVAb6qSrWClAeyCzTYQbY0U0lQZvDMN9dW NxkENGwzpJ3ZuwW7HwWL006mBmplxK8mDHhH8FDAHAMJU9usKS0Rm3Cn6g7n1oUsR/O7 qfEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc:to :content-language:subject:user-agent:mime-version:date:message-id; bh=WZvTLp2FHzfdUslFouAcmN0K9Wh9YsL1rVcnNlbgcDk=; fh=+/g6PWgXleYSFSoNg5GLwbGCrronp6Kwb0zX3yLny2o=; b=VkpI+vLKB9Dn36DryNg55//v0tCGmk7jP0iVaX4AafHg0LCHziGaRvUVSKEsuP6hut 6tHkHk5q0LqALTNurAzjvtNKwxoLe25Jlx/zpFQIGY1R8/u7SmwuZp/eLES9CWzMu9PD tOO9mAaZJ8TQAw4qp4APF3cM4GVKHUnmAByUAPIXzqII6P34uCwjTFhgLF8fjFlEio2+ 48YtTKfdp0AzSijfdieZ9w6Y/YiAo4bITqrgPTYQRGqtq5+KVS2ajypXDWtUkWPXynrE NCNiKUsh+rDSvmq3PV7tibL7CYoUb4QMfbsrSrnLfJE88nY7yZMpwdSxb2cNOfClqzaK G/8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t10-20020a056a0021ca00b00690f191430csi4331575pfj.56.2023.10.29.19.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 19:10:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 554AB8054EFC; Sun, 29 Oct 2023 19:10:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjJ3CKZ (ORCPT + 99 others); Sun, 29 Oct 2023 22:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjJ3CKX (ORCPT ); Sun, 29 Oct 2023 22:10:23 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 5D3E693; Sun, 29 Oct 2023 19:10:21 -0700 (PDT) Received: from [172.30.11.106] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id F16A26027E05D; Mon, 30 Oct 2023 10:10:05 +0800 (CST) Message-ID: <7555437b-9289-eba4-efa8-965386e0e956@nfschina.com> Date: Mon, 30 Oct 2023 10:10:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2] iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw Content-Language: en-US To: Jonathan Cameron Cc: Jonathan.Cameron@Huawei.com, lars@metafoo.de, jean-baptiste.maneyrol@tdk.com, andy.shevchenko@gmail.com, chenhuiz@axis.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui In-Reply-To: <20231027145949.243f03f2@jic23-huawei> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 29 Oct 2023 19:10:34 -0700 (PDT) On 2023/10/27 21:59, Jonathan Cameron wrote: > On Mon, 23 Oct 2023 12:05:52 +0800 > Su Hui wrote: > >> inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the >> true value rather than only return IIO_VAL_INT. >> >> Signed-off-by: Su Hui > If you can figure out a fixes tag that would be great. Just reply to this thread > with it and I'll pick it up from here. Oh, I just send a v3 patch, sorry.... Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support") >> --- >> v2: >> - fix the error of commit title. >> v1: >> - https://lore.kernel.org/all/20231020091413.205743-2-suhui@nfschina.com/ >> drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c >> index 29f906c884bd..a9a5fb266ef1 100644 >> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c >> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c >> @@ -749,13 +749,13 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev, >> ret = inv_mpu6050_sensor_show(st, st->reg->gyro_offset, >> chan->channel2, val); >> mutex_unlock(&st->lock); >> - return IIO_VAL_INT; >> + return ret; >> case IIO_ACCEL: >> mutex_lock(&st->lock); >> ret = inv_mpu6050_sensor_show(st, st->reg->accl_offset, >> chan->channel2, val); >> mutex_unlock(&st->lock); >> - return IIO_VAL_INT; >> + return ret; >> >> default: >> return -EINVAL;