Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp505381rwp; Wed, 12 Jul 2023 17:35:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlHtmlmzEFHE+mIRC5FuaT0kWJ+xe9wxBZOiBlS8DDaFpwRrejWid0/J1fHJw6it/9hDvYUZ X-Received: by 2002:a05:6a00:2492:b0:64d:5b4b:8429 with SMTP id c18-20020a056a00249200b0064d5b4b8429mr258007pfv.18.1689208523886; Wed, 12 Jul 2023 17:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689208523; cv=none; d=google.com; s=arc-20160816; b=EL8eiKrtsf8sJcFPlnHccppi8b/zefjRFtgBy25e+HZWtBHNPDgAsNNliR3ZZ4salS McmmfbCto1kRU5GF+5bw+OiZPYS57o8ULw9U5s163rF4cJ9g6FWuF/ec6o6qYntQ10xB 0mQ+X6X403xs/V2Lb22k5k1ixNtzkgtX765GaHCB/wYKR1IWz3Cw2MB72vycMTkCaEDY ru5CC4oyBpASqmBspqdV+XKPkONfjd+hsFwqNioeBmuqAsQFlCzwyQXyS4u5uCf8sTz3 fKqNqP1E78GthpOtSuK1vlJr717U/TI+tOTykDzISIsWYlbI8OXQ03VnwzB0CE+QS2Bt Vxfg== 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:dkim-signature:from; bh=8cm9cja8XL2rCBCqlqcKUvUApZuVVpAPa7biOOnikt8=; fh=ZiM5mDy4GRzLoe+9OtNrxLQIV2tDdng8OQm7C5ykaaU=; b=OkEpeCdI5JKWQgObwdawDvlwWbyvziP2RjgHH3htJkzbQgU8uYVVf1ceTUKTE8pTi3 nqxzhhFb6lLD0cVDjdOI3fDdn9s41IU1ZilmMcOw82gOYtXuubT02wiQFZy2nugUohSs +TIDzOpT2VuddU3VH9Cp4QpGheu4PvMweZgdp+YdWz7S6HsG1PFAeO5j9o5OwdwSV6qB p8EzNDS8tzDQqUUGXBvbjV9th4CFa6KObkDGgKTuUQQG4xdz0t8psvQwhjDeDkRwBBR9 kBWj1P0yLzvVZlOWwldMGFFWgAxHrzYrak0yzCiHvNf2WSXLrCQdMh2vhTagQmUg5sEk Xl0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dnyon.com header.s=mail header.b=gXGkKF+F; 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=dnyon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a056a00088500b0066e4ceca38fsi4239189pfj.283.2023.07.12.17.35.12; Wed, 12 Jul 2023 17:35:23 -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=@dnyon.com header.s=mail header.b=gXGkKF+F; 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=dnyon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232625AbjGMAao (ORCPT + 99 others); Wed, 12 Jul 2023 20:30:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbjGMAan (ORCPT ); Wed, 12 Jul 2023 20:30:43 -0400 Received: from dnyon.com (dnyon.com [142.132.167.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C9B1FF5; Wed, 12 Jul 2023 17:30:41 -0700 (PDT) From: Alejandro Tafalla DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dnyon.com; s=mail; t=1689208234; bh=OqvMagDHrs9sGhzHEnKv1/CpHc2sIgYQxc++nItrEtU=; h=From:To:Cc:Subject; b=gXGkKF+F71ogzf/2taKOshImmn61+Rct6eaD8Yuijekx/aj2OLxUtOkoVC2Z5d4V+ kiw0OsAKWaYsk+obUhQCC9bfhmn4dl0JN95FW6zzyEW0J+NXGXJVaFDof5jKhrirDh ozH58IGZthpyx2F3WNSkG67GVV0/WBkvISTOLXPb6Ht7nBTZt5G2J0RezJ4TIXv5xm douxSHt++6oxFHUEzz2Rx1eluNhgAcjJF8iFT30fGrTAWqORCBfLgG1N6zcPObpoSM Yykwqy+6aw+5HY+uYuRUR9C+sbRVLpkC8RVBKAAiqxwfxpcKg8arJMINdSEaxMi66d kU8MSWoDsqBo39kkFtnlmPPvbGPOIII8EImwce6liR7qWKZdbEk7wJ913sbNnIdYuL iZs1cNHLIqg/fReYAPn4TfTHhzpYvh2XrOFSmHcZz2Lo/BkR3wG1sxXQistFXqHCRQ +te1ekxYxJgq9eIXYteq3zER5n3jjadkyKeyrZxu+jaIvpRbYKSDwmqwOMn6FeMOMW oXa7UgilBbRmL28Tj3FY3JVcRXKbtNBrc3EGy9kL4L0j1lHa43YMWBh6nzxqddNQqM dNqDnxKBQDIg3rrlwTdwqTr38SLTTH3i3HghLrnersA+zHch8MTUjjxL2KYmm78UYB 0vSe4cPKRjHEIkjtbf9zCZCI= To: lorenzo@kernel.org, jic23@kernel.org, lars@metafoo.de Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v2] iio: imu: lsm6dsx: Fix mount matrix retrieval Date: Thu, 13 Jul 2023 02:28:34 +0200 Message-ID: <5690549.31r3eYUQgx@alexpc> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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 The function lsm6dsx_get_acpi_mount_matrix should return an error when ACPI support is not enabled to allow executing iio_read_mount_matrix in the probe function. Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval") Signed-off-by: Alejandro Tafalla --- Changes in v2: - Use of error codes instead of true/false. --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/ 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 device *dev, static int lsm6dsx_get_acpi_mount_matrix(struct device *dev, struct iio_mount_matrix *orientation) { - return false; + return -EOPNOTSUPP; } #endif @@ -2767,11 +2767,11 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id, } err = lsm6dsx_get_acpi_mount_matrix(hw->dev, &hw->orientation); - if (err) { + if (err == -EOPNOTSUPP) err = iio_read_mount_matrix(hw->dev, &hw->orientation); - if (err) - return err; - } + + if (err) + return err; for (i = 0; i < ST_LSM6DSX_ID_MAX; i++) { if (!hw->iio_devs[i]) -- 2.41.0