Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2522025rdh; Sun, 26 Nov 2023 09:09:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeImna2uLMJ2t4fGMSoCFT0JAUG0riWIQ77QtxjmvILM4wL2ipQ7586FvcyrioqbJz9RFy X-Received: by 2002:a17:903:4282:b0:1ca:1be4:bda4 with SMTP id ju2-20020a170903428200b001ca1be4bda4mr8854156plb.4.1701018596836; Sun, 26 Nov 2023 09:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701018596; cv=none; d=google.com; s=arc-20160816; b=qarTeLa44h3EDdLiGmRZUP1qgbuOcnSvPxecqxOh5dH/tu7C10qHhemXY0itVl9mKe ewI331Us4oQOcJz86UFyU6fcU9XffMamKKsVS9CJt1mVPlLzHG+vJk4ug/9fhRhi9jEO 8ptufiZxiWfRP4n5+3ZSDg7G008vsu5n+kYyLlLMYOv76ilFHRy3hoywTC0SLQgGm/Nq cMZnK47GeG388tgj1zT733rqEZ9mr1/cqChlXG87PCwrYRWG3nKSmsZEAnW2KXqlRwOE Djnd2OKG/0rWGMiUgq8DPgpbQApyfwaTZkCYtUR7cP6Udqj4OOskgdc82dPz9ugLjNXK pBVQ== 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=b9qrFOd5k0R+WZKtq+KSSdMV2wZx8fdHLdgjUlAu4xU=; fh=HXRzwNtYqClZgi5uIKDZh9wH80G45e8it16n2kEQP6U=; b=M5DRdHXYUcqfe/pE4sY+JCQPUkflrbD3L7WEkvacSd0lSCzOaSjmrgA86+IQ5iEn7A 1+qetPrC+2wLuySX1Trvyx6VqGMFWb8aZELsDcdtSNHzd6OIF6jhwYkWTvuovXoNNC4A AjdlSTIOsdAOkhX6JQIgPXgjQI7LMGR8aZE4OksbfDukjRBkapuoaD7PNVv2Cl42muWv Rg8t9J5+SYnbjQBV6QCHQVoQFoVaTAI/0+drA+DWyho3He5dTUJGV3CBJkEMV2V15PLw 6BmDQvIGQ0BjTinJu6qgTcXW3cyLJv6pguCNdj756EUXn8GzyKr9B0OyzvfePVNdUP+/ agBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=COWYlnyu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id n3-20020a170902e54300b001c5fd2a28desi8452956plf.222.2023.11.26.09.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 09:09:56 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=COWYlnyu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 29970806002F; Sun, 26 Nov 2023 09:09:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbjKZRJi (ORCPT + 99 others); Sun, 26 Nov 2023 12:09:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjKZRJh (ORCPT ); Sun, 26 Nov 2023 12:09:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AEE6FA for ; Sun, 26 Nov 2023 09:09:44 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE5DC433C8; Sun, 26 Nov 2023 17:09:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701018584; bh=S3oBnSKIVaAwos9u+x7GmQmmKapxv7I388lspEsC2bI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=COWYlnyuDob5yZ/8Wr0ZT0tTymWeBTs52UHwhZ45F7Vf49nLqkI/Zqz6Lu9snAc7K rD3LPgpyU6NjlH1idl6LlzIhSuqwTK8+T9Ai7hutimfIPITJmSY82Ta08JXAYFwiQn A0Fw/9ZjDl+4cJj3FKonCc0pZu1Sx88r0G2fmRwITZo7v/uEYIGe/n238eRE8zTIzq X0KmtkrBdYwJQ4q8MZJMjtowWZSOblsA+frByz9n3jTZhSltS0bbzaIc4obztti8Tt cQ10yzvs+unZa+dYECjn38p7l7jpd+2VK/1PonTEXXfZSVzK1DC804wU934mWZlV/b KsspJp5eQJA3w== Date: Sun, 26 Nov 2023 17:09:35 +0000 From: Jonathan Cameron To: Su Hui Cc: lars@metafoo.de, jean-baptiste.maneyrol@tdk.com, andy.shevchenko@gmail.com, chenhuiz@axis.com, mranostay@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v3] iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw Message-ID: <20231126170935.3074a06e@jic23-huawei> In-Reply-To: <20231030020218.65728-1-suhui@nfschina.com> References: <20231030020218.65728-1-suhui@nfschina.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; 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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, 26 Nov 2023 09:09:54 -0800 (PST) On Mon, 30 Oct 2023 10:02:19 +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. > > Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support") > Signed-off-by: Su Hui Applied to the fixes-togreg branch of iio.git. It's independent enough from the improved error reporting that they can hopefully got through different branches. Thanks, Jonathan > --- > v3: > - add Fixes tag > 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;