Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1179915rdh; Fri, 27 Oct 2023 07:01:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFz6bW5rvripasOu+GxntMj/QesNdKLPeDgbTgzK7jymrxdXpO6o771CAHcde8b3SadnbDz X-Received: by 2002:a25:2588:0:b0:d80:68d1:b826 with SMTP id l130-20020a252588000000b00d8068d1b826mr2477030ybl.6.1698415304548; Fri, 27 Oct 2023 07:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698415304; cv=none; d=google.com; s=arc-20160816; b=Icx4kfRSPBTXcEQDZUNHpC+Cmffqy8NFtiS+kq5O+Q8hGdlQ21x7AIxR5cd5EzTJVU TMpwsq/Kzd4U4z1ITvKrdNPMXJE3U8Y/H+9dd89UIHXyF8lz4z1ulXIvVxVTmqAJw5f3 8qIGR8v1PXOtZUTQEeQr9t3SNZJzZh0RdTUoDbEAILxyue6d67nysUAXLmZZYD83snRz gqQggLTIraFNUloEOZ8YjnuNBODl6uEc8pcjLp1uV0JFa+t5llEOp+zBM3L6dNuNYMPH sm8QA4fJ8qAqmFt8nRxRjh4eFtHWjQWRSEUZ+WyIXcVeHep8LScb+rUuPS1nndUWbYOl jAbg== 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=6sFBqpyyKWPFufY4n/jYj/a60haSrIrdS8VpbPMnJhk=; fh=XxMbkNADnv5unK3BrGfyGQ1QJ3jUEBwPAsC8ocNTOk4=; b=dgMtE0XX/Iet7MIKonZKRXUDHWuYC8k7Ab7qNH2OqtR1YJZk41g0jYAbHKXApbK5oI qPv3KVLgQP7YTh289ja6YX76J9L4S0E9aVxzPzhmyt/45MrOQZv500B+SQSpRAxzyPMl PYczUeBobyFucj41RKwsTySRUZON+/sTClSbnyR0Wr6iQ6fCP6qFQqcX0GDIr0xoO/cv mATuTW/w0ofImV+iNHo36z5KxLnL01y2dOhLgrGrxYdt6mqwOdE+SH3eRO/rVKkoTmeE BwpMv3AeKXK87DnbstkFD07nSjBS+toCpRPKWb0ZxBaXhsvFOdBus8jiENvsP9D+j1TN ij6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ADOKI5eR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id r39-20020a25ac67000000b00da050e6154fsi3056066ybd.120.2023.10.27.07.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 07:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ADOKI5eR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 749C18093401; Fri, 27 Oct 2023 07:00:40 -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 S1346042AbjJ0OA1 (ORCPT + 99 others); Fri, 27 Oct 2023 10:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345998AbjJ0OA0 (ORCPT ); Fri, 27 Oct 2023 10:00:26 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E103CA; Fri, 27 Oct 2023 07:00:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90C8DC433C8; Fri, 27 Oct 2023 14:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698415223; bh=GqUoq/JnTOGA/NUBYPlElzP2R5B+dPinIucjNVQO58Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ADOKI5eRQ/uDfirD5R4HAl777pjX1RPv5Jo/nnIGwlYynfqbxIi4nzmHrHnj2PNj+ h6XDezDrxVS/0yfog78g82NpzP4W9lxhQUPWph+rvb1MROQEt8GhMfqq/SVwIHNeNM oLNwXM+JaC6vhyAV2IH5bCJOUgxwnSAsPn2/Y3LnQNpf+HxsoT6Nz6oivWcr+TtYkZ k9/Cs2Aq71ksZbXLlD6gSzSHx5fxHYuWd2En+QDWwZX8D4loMvV9ncXBvuFFvTPk3i pT5a+BGHCPOT2bU5ssZFS2MVzP9027QiZqbhB9Wlyli9UuBIkCHYdiEg8FfSGsoY6L d4HLe1TLE4ieQ== Date: Fri, 27 Oct 2023 14:59:49 +0100 From: Jonathan Cameron To: Su Hui 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 Subject: Re: [PATCH v2] iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw Message-ID: <20231027145949.243f03f2@jic23-huawei> In-Reply-To: <20231023040551.68902-1-suhui@nfschina.com> References: <20231023040551.68902-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 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]); Fri, 27 Oct 2023 07:00:40 -0700 (PDT) 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. > --- > 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;