Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp994053rda; Sun, 22 Oct 2023 21:06:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDu3iiT9T2APueCgB7e3nSlwzYeMYl/PT0nne9zZy1RqELHPa4E8LfttMZ9Z72aQUWLhKY X-Received: by 2002:a05:6870:b4a1:b0:1ea:2879:c137 with SMTP id y33-20020a056870b4a100b001ea2879c137mr10426931oap.34.1698033991560; Sun, 22 Oct 2023 21:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698033991; cv=none; d=google.com; s=arc-20160816; b=kuAM+0G696o6noeLp5g5mEf38F93JoNoqsA+Xbqc0wsiq2an6egnVa/cTei1kt8o95 saojiSuO/ukTRoPaqD19bAnCRJlmdTKrhDgD1BiN9RpovBWGiom+8fHpS/AOkjUXbYxM 144PjXLLzkkvUou0RntaJt9uOGE705CGuRCgGMOykFjrmdroNQ7uesxOAid4qItwCMH/ N0lW/bm5FN+YY6aqcHK8KC2qiHeekjrJIj1Vyq52FQ7J9A5cEja5kE/3uIfRDbu21ws+ P2ll7qjCleqhusMGxNC7HuoIZzXiPszupQejoUM9/2GWE/Cf+uwfPtMHUOX5O4cuUbT1 NBFA== 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 :message-id:date:subject:cc:to:from; bh=8MF9+T7IN61FCDlOJYxMfPxHSg9F9cPk73DObvrGhAU=; fh=0a30ByjDfx+2Dd81KAi0gpn74tcYfHumzNFotWA2KBQ=; b=LSGDRoQPCII6kB0ym/V2LVg7YhZ+8C7YvBd9BGv7vIaHOVZTtUTAkuDF+FAM4MshnR iKGebxRDHyhJWFxsHMy3EvcX70ExaV0oCD5NDo+35LKLcsGEgfD91xpwQMcmxNYVKnon v1aF2B2nG+/UxR844bcWCvCXySFj9J67sqFWyi2iudoaEUnJFNVE4yms57ef7xl5i6yx bghFPLpuUWy2U/QKouJ9UnOtOYAAwxH8//bpylKMafYG1EPVu+6N1kwnR/k1PZeNUurj ogzAQksxiMqGFf0lnnF4ggC6fDw5oaYaw3m6D328QXqqp/u1YN0ApqRskd8UqwhW2I6x pvlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bt20-20020a632914000000b005898d997f52si5921532pgb.66.2023.10.22.21.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 21:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id D7697805BC9D; Sun, 22 Oct 2023 21:06:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbjJWEGW (ORCPT + 99 others); Mon, 23 Oct 2023 00:06:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjJWEGV (ORCPT ); Mon, 23 Oct 2023 00:06:21 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 4FCCBD52; Sun, 22 Oct 2023 21:06:17 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0C07460106CE6; Mon, 23 Oct 2023 12:06:10 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: Jonathan.Cameron@Huawei.com, jic23@kernel.org, lars@metafoo.de Cc: Su Hui , 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 Subject: [PATCH v2] iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw Date: Mon, 23 Oct 2023 12:05:52 +0800 Message-Id: <20231023040551.68902-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 22 Oct 2023 21:06:30 -0700 (PDT) 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 --- 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; -- 2.30.2