Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1164681rdh; Fri, 27 Oct 2023 06:37:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtk5047UoJrFPBEkRC1hnmjb9VO8j7K9Myd0FXcNBpEXh9Q1zIxIQ7kJbNDNBimL1rf2OG X-Received: by 2002:a81:a742:0:b0:5a0:ae01:803c with SMTP id e63-20020a81a742000000b005a0ae01803cmr2983195ywh.38.1698413844537; Fri, 27 Oct 2023 06:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698413844; cv=none; d=google.com; s=arc-20160816; b=mzE83T+UyaPd/BJlPZF5Wagg0gCChbePZFpfgn3Tj2hDaLO9bE7V6t6tfqBqOSHvhh Owundd8S42RyM50R1DPd1Zbl2xWiL8ID9mVnKU/Bz05OY7KjKO+/xuscsjzfVc/gO3JP xvSUCD/QKO/FIayic0C1mZ14jv3fUISyQ45iiqCFyJSojETkQF6Mlsdn/ozKOWmjii8j Od9Kldix5iMt7vsQ9ZIBpn2xDk/O0/Hcly9PPsf4DWt1aeKjgAZ7CPuotYz60Mwp3QUV BM1LzVtSYsOQoJAkE4Dc0DNhsrzsm/UfJ9xzNf5jJ8o1ZHneQb35y0f5DUCQzAEcrbeV 688A== 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=0xd7P4qYVmXOKMAZZhnxdTAzptuC3esnYUCmJULyCB8=; fh=Yu4QB0e1xNlj3Ft0YUYIWh+vRBp45LC/gpbAiloEw1M=; b=iQHp00QznTR5W6Z6Et8WqYeYVPiuN2qqBx76Rldrqw48VPydA4okiUdJtEas+sHj8Q EQCuvzuytjQimjnh0OqelOprTz7lq4vesENhEJvpy/cJv8b9HUvpgrTxYprBsqAe41m8 Uw8zdc8ANeeazJW15AO7id9BUQqkIXVuutIuI8VuDhfpzonY0FEFlbmGBvYMdHesZfAb M5T28+e2zAeLDrNIqV+MSV8aRbdRlc2QN2wxFKLpxWM6e/OwF9LzRnjWkTbA5fO7cWJ+ 8l0f7ANPpgAcZLX/a9aL7N6rZdDVA8Fe8YvVR/efx1dvlEqhufjbHC7d3E1G6M6dcjl2 UaMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kdr9xBX/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c14-20020a81df0e000000b0059f6860a29csi2573358ywn.365.2023.10.27.06.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 06:37:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kdr9xBX/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id B04B4836E5E2; Fri, 27 Oct 2023 06:37:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345987AbjJ0Ngq (ORCPT + 99 others); Fri, 27 Oct 2023 09:36:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345978AbjJ0NgR (ORCPT ); Fri, 27 Oct 2023 09:36:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B589D6A; Fri, 27 Oct 2023 06:36:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69C3CC433C9; Fri, 27 Oct 2023 13:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698413762; bh=0xd7P4qYVmXOKMAZZhnxdTAzptuC3esnYUCmJULyCB8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kdr9xBX/kVeoUGv0I2qU4a9zqQb7P/6SbXYTGPU6CxbiOzYbxWkQHsNaJcRVFujoF U0hjXSHePCG+09skR+SGHmFydgCkUuZY96ngHKMSarHPmP4lK7aEyKKwrynYU8h+m3 /KDNuGlLsUGWxuLTYPWb1urXHF1gbpyh/fg/VO/duWGc7gwk3R3HTLXe4EQm1s+avX rwvuSnqPM4cRF0x+eIWMH92xZAqAB0SV9bckKz3hNyaEVQ54L4FVj455UZBfleB6xd VQPXHbTEJ9XRX12x2214sI6LAkNjylDNAkUCvXSU7hoSSEdeAUCyMXys1HynEklUiu ciSQwbc2OTpRw== Date: Fri, 27 Oct 2023 14:36:00 +0100 From: Jonathan Cameron To: Su Hui Cc: Jonathan Cameron , lars@metafoo.de, jean-baptiste.maneyrol@tdk.com, chenhuiz@axis.com, andy.shevchenko@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 2/2] phy: mapphone-mdm6600: fix an error code problem in inv_mpu6050_read_raw Message-ID: <20231027143600.2dd74f78@jic23-huawei> In-Reply-To: References: <7f81d365-0440-de01-8be4-9c8d3ab9d69c@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=UTF-8 Content-Transfer-Encoding: quoted-printable 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 06:37:16 -0700 (PDT) On Mon, 23 Oct 2023 11:29:30 +0800 Su Hui wrote: > On 2023/10/23 09:33, Su Hui wrote: > > On 2023/10/20 23:55, Jonathan Cameron wrote: =20 > >> I'm not sure why inv_mpu6050_sensor_show() doesn't return > >> the actual error code from the regmap_bulk_read() and instead=20 > >> replaces it > >> with -EINVAL.=C2=A0 Given you are tidying up this related issues perha= ps=20 > >> change > >> that as well? > >> > >> static int inv_mpu6050_sensor_show(struct inv_mpu6050_state *st, int=20 > >> reg, > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int axis, int *val) > >> { > >> =C2=A0=C2=A0=C2=A0=C2=A0int ind, result; > >> =C2=A0=C2=A0=C2=A0=C2=A0__be16 d; > >> > >> =C2=A0=C2=A0=C2=A0=C2=A0ind =3D (axis - IIO_MOD_X) * 2; > >> =C2=A0=C2=A0=C2=A0=C2=A0result =3D regmap_bulk_read(st->map, reg + ind= , &d, sizeof(d)); > >> =C2=A0=C2=A0=C2=A0=C2=A0if (result) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL; > >> //Make this return result; =20 > > > > Sure, I will tidy up this, Thanks for your suggestion! =20 >=20 > I'm not sure=C2=A0 whether the caller could handler this=C2=A0 when retur= n=20 > 'result' rather than '-EINVAL'. >=20 > This is not a big problem, maybe we shouldn't modify this code. If the ultimate caller (userspace in this case) doesn't handle other error codes it won't work with lots of other devices and is broken. So I doubt any code is that fragile. If we get a report of a regression we can look into whether it's sensible to resolve it. So fine to change this, but could be a separate patch. J >=20 > Su Hui >=20