Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp780305rwp; Thu, 13 Jul 2023 00:23:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYedhg9/oAQZXKMrJGdjerp4oHtZcbMaNQwN+hLA0yTzbZ7U1TaqupXPiQcdR1RaiCqXaQ X-Received: by 2002:a17:906:ccd0:b0:993:ec93:a5ef with SMTP id ot16-20020a170906ccd000b00993ec93a5efmr553965ejb.47.1689233031147; Thu, 13 Jul 2023 00:23:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689233031; cv=none; d=google.com; s=arc-20160816; b=uV0zptHheDrE3EUAOJ1xCoe/qO25bHpq1JDpnGLoIeeet6yeK5dyklsYnxeLEkmiC+ mrWrqJQJvoe+d9b9liAc6qeH0F0VbY7GqwFNO7xtl7V2W5an/nBMgWrQ8Fwws6SLyrDs ueXPuV0TZrgQBzg3p6pcbGugz5rKNkoCm80pNGGSPwLtIaa9iJYBXVHyF9FMMT1PLdvz 49yZoKb4JW51jBrO/xz5jJSqLPDKldLynzaiLhylJkTV1/fR+1AZxqJ/sGmaSTid6xwb e+LFXMwimNzT6CSe1y/I4nsgEmZiwP0Cumi0AfiSlASlnd18Ex8SozvQFWoqzjZ8cF19 FB1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s1XxjmQSDdTCFtH9nuIAT74gIuTNDwSN2Y0wbb+9EsM=; fh=Nk4bSZzbXEIp3xNmTIjOSi4ccTDQh8iN8/q5lcD5hio=; b=sqcFMtl+QJNhDiCA0A4Jdz3UG4TVJHIiWLnaz07CVG0IA79Uc+fkVR++Ppxs80I9Sn 7RDz0BKWAmg4Xm+L4NqsEPW//oDi2FWVkDJvIY6c+vtaOlN+3+JY3YADyL3/dksyLlxU Z39n/cOm6mnCZZ8GlnlFEMRo3Ek8SDhL5YYH4tq2zFxDLApNlu4RVvsmQOdXqWLC269q lzYvM1t6LGB7qhHYDzmL/dt1SWzmsan+yM81u06LRvD5jSdDj4wnsoj7zAUpdTk1X1/H XKFqSFFcPDLg/PnRrs2FH+wfTlriS72pBaXsLefgXVTaYDRjK+rNh7p7HFsFE07ij7is /Mcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UpKOhloD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k27-20020a1709063e1b00b00993032b5db1si6467683eji.726.2023.07.13.00.23.27; Thu, 13 Jul 2023 00:23:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UpKOhloD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234093AbjGMGp6 (ORCPT + 99 others); Thu, 13 Jul 2023 02:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234078AbjGMGpu (ORCPT ); Thu, 13 Jul 2023 02:45:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 198401998; Wed, 12 Jul 2023 23:45:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9EE8761A34; Thu, 13 Jul 2023 06:45:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70414C433C7; Thu, 13 Jul 2023 06:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689230749; bh=QdqoMXXDocWFm5bXrCU/+PhGlp5BHVUakp74/t5bQw8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UpKOhloDcMQEfbql1x8e+dg+Li4h6ErUzD4oD1xqZyEbvIMZ7rnXO91uLPFxxsHU8 g1mk+VbaYE/8VDqZ09QcJWesrwdxL0M5Ms0ubcMoeMgYAKYlSa4uYK3GFN1hMkt47r 5p72Br7Z9XNhs1wcFu5/wPwfQOlKt9WRBVVJDvg0MvkTTR5iziImCACay+s/sb9hw/ jWuKIuyHz1gQTkhe1U+bpdHPJzIT5bEwX/pm7wXOzLpGv0dmb6sRYk3s9q9nP3hozM ZhamJNGfoB9ekD3gRbwOx4eqhhSU//dKRqtgI4EFvA2odb3fDXPVSnfH0VUUE3DiH9 QRn6Y/zHofvHQ== Date: Thu, 13 Jul 2023 08:45:44 +0200 From: Lorenzo Bianconi To: Alejandro Tafalla Cc: jic23@kernel.org, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [RESEND PATCH v2] iio: imu: lsm6dsx: Fix mount matrix retrieval Message-ID: References: <4847336.31r3eYUQgx@alexbook> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AQXm/7OLTLW6eLTI" Content-Disposition: inline In-Reply-To: <4847336.31r3eYUQgx@alexbook> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 --AQXm/7OLTLW6eLTI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jul 13, Alejandro Tafalla wrote: > The function lsm6dsx_get_acpi_mount_matrix should return an error when AC= PI > support is not enabled to allow executing iio_read_mount_matrix in the > probe function. >=20 > Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval") >=20 > Signed-off-by: Alejandro Tafalla > --- > Changes in v2: > - Use of error codes instead of true/false >=20 > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/i= mu/st_lsm6dsx/st_lsm6dsx_core.c > index 6a18b363cf73..1a4752c95601 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > @@ -2687,7 +2687,7 @@ static int lsm6dsx_get_acpi_mount_matrix(struct dev= ice *dev, > static int lsm6dsx_get_acpi_mount_matrix(struct device *dev, > struct iio_mount_matrix *orientation) > { > - return false; > + return -EOPNOTSUPP; > } > =20 > #endif > @@ -2767,11 +2767,11 @@ int st_lsm6dsx_probe(struct device *dev, int irq,= int hw_id, > } > =20 > err =3D lsm6dsx_get_acpi_mount_matrix(hw->dev, &hw->orientation); > - if (err) { > + if (err =3D=3D -EOPNOTSUPP) why do you need this extra check? According to the previous codebase, even = if lsm6dsx_get_acpi_mount_matrix() fails we want to fallback to iio_read_mount_matrix(), right? Regards, Lorenzo > err =3D iio_read_mount_matrix(hw->dev, &hw->orientation); > - if (err) > - return err; > - } > + > + if (err) > + return err; > =20 > for (i =3D 0; i < ST_LSM6DSX_ID_MAX; i++) { > if (!hw->iio_devs[i]) > --=20 > 2.41.0 >=20 >=20 >=20 >=20 >=20 >=20 >=20 --AQXm/7OLTLW6eLTI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZK+dmAAKCRA6cBh0uS2t rF/sAQCLa9z1VQ+pJmnDyrf/ZO2ICFgjaUS1iye/28z/ZhkLPAEAtOSPoVSeW06l 1tAOk/TsiJWcW/3gXq/ncQBrp8/qKA8= =pvG7 -----END PGP SIGNATURE----- --AQXm/7OLTLW6eLTI--