[v2,2/5] iio: accel: kionix-kx022a: Warn on failed matches and assume compatibility
Message ID | b6cb3d48ab9e4177b924b18e27487f8ef763dfd6.1682019544.git.mehdi.djait.k@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp595474vqo; Thu, 20 Apr 2023 13:24:56 -0700 (PDT) X-Google-Smtp-Source: AKy350Ye0a4HCuZba1j01lcURYJm6UP6IqIpQoyX/kkbMMBXyTDEV2UyFQqbLGGosUx9szHYUubJ X-Received: by 2002:a17:903:40cb:b0:1a6:9e53:950e with SMTP id t11-20020a17090340cb00b001a69e53950emr2707373pld.41.1682022296034; Thu, 20 Apr 2023 13:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682022296; cv=none; d=google.com; s=arc-20160816; b=hhq9+7U+2i3AB7xF8KLVoTE7BBBr5cZCAcgXe6Qd/tgd5rC4DNoA989V4XtQGQTphA Dyxyt0wP77L8HCF2GODw+wEzqn1HYUWZeXM5Vvy+wZ7ckIRK2gZ+0C7etujcqd37/F5a b2jcyhrIDv60wFZ+qQLorERdW84gBRXRMwG/064jBGOCrUy4Tnh+94Z5Ie1qkZV5FLpR UHyWDeIohXDEevWGQjaereJuG+2MIKhgW8bR7/2lGhF8RNALRrI1Ii1eLCAPzcV3tZAi vSdnSGGj6IBWTz53U4iU3yWnKjYDr8T1ez4AryREJAvVUh6PilmWvXtv9MYDxJuhdxIC WQTA== 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:date:subject:cc:to:from :dkim-signature; bh=1CydptxKkm22NUNjkNivJRkww6tHUqJf95wdwrAx7jU=; b=I+cHosesgn1NeLbOmG+YWkFUl2kM84pfwXY5p/1lNqHFLGh6PP9lSmdL0kkuaSwvSk ev6zRbhJxBSH85fxVGKS/qcXX+xzBlWkLk8t20cMLos1WGbD8rYvTryiSTKKvcUFtpx4 yB9uftwJ5v3WKvRmfcl1CuFQM2iIjwYwL2hga670mo+z7Juqf0W9+Gw9zkJpXN9jUMFK wMKv6MUEEriuODDICvsgiJPUlyQV8uoBsyd2Rbv29KNQXqI9vMbxYHCrl2HmFcVOpJgG m8U4GUmuIB8m5YFjPT4dWTetsarpazlzyYZ077sqtfP+TYQvykOjcZA2dxAK0yQ5OAA5 7H1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qeZdazHX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a170902c94d00b001a64fba3382si2815047pla.148.2023.04.20.13.24.41; Thu, 20 Apr 2023 13:24:56 -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=@gmail.com header.s=20221208 header.b=qeZdazHX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbjDTUXa (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Thu, 20 Apr 2023 16:23:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232341AbjDTUWz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Apr 2023 16:22:55 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3105249C7; Thu, 20 Apr 2023 13:22:37 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5066ce4f490so1229768a12.2; Thu, 20 Apr 2023 13:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682022155; x=1684614155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1CydptxKkm22NUNjkNivJRkww6tHUqJf95wdwrAx7jU=; b=qeZdazHXe++2TOz6hvvgwzCsDzhhk45FRYs2NVtXMhGJ4HQz3A+AAdQuLlhfx+ek0Q zEMT2iZhflT0Q4z/sJUxzhEsmcUF9BzftQGVPF4n4v3pZMZ//P1UnjtOWTdOJB9khQqX Hn9Q500M1/alx6dfRks6T16p5Q/O81egJtUc/YIdkJ67rVvA4Tezoh42D/0FJHxwMBLC RIUjbBuvPhNJxJ3JWUypcla+jkJ+KFZW1x1HzNFi59O/p/5SICqJY2uhnf/0H+DxsAOq gibIKpIXRuXoDfXZaFrekhy+SLs6UMsmPIVhY6+cnMsx3wDB7xl68wdfUGXfuVTucZio Wdrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682022155; x=1684614155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1CydptxKkm22NUNjkNivJRkww6tHUqJf95wdwrAx7jU=; b=TWW+EQOzdZVLj007/Z/JLi1K6wHoDvzfH2aZd97o9qniiifWJLeOzlHwJhwu5Bv9Pj O18CfLGtozTzl1E6o1TjI5VzXO+oI5K2MmlwCIDyDvq6zTwslaQeLGACLaelmTkd9Txo y35QGPWYhUCJ+66NlCSm3Za0zZEj6XoGnnXJ7/7uL4u31h/vg5DFd+Tj+0PcB5N1xaCi cij7V8XxdjfHHUexaUQiDympweXe3R3ywsxwGOdv8ZGds3Bgg7yOalIjRO20X/tfvh51 uLCFndBqX74hdlpNIjdr+d59BBcP7QQQuREApzOwvg75rYQn1abmq45099PnWNGKdKmj xJfA== X-Gm-Message-State: AAQBX9dG/AOXxmevSP4cP2hfewLuzojxnwRNaib15qVIkuJCCDVjc18h QggSkfaqxJ0GpWoACyf9NP6cD3r88UQ= X-Received: by 2002:a05:6402:53:b0:506:be49:243a with SMTP id f19-20020a056402005300b00506be49243amr2931571edu.15.1682022155559; Thu, 20 Apr 2023 13:22:35 -0700 (PDT) Received: from carbian.fritz.box ([2a02:8109:aa3f:ead8::d7e8]) by smtp.gmail.com with ESMTPSA id q14-20020a17090676ce00b00932ba722482sm1136881ejn.149.2023.04.20.13.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 13:22:35 -0700 (PDT) From: Mehdi Djait <mehdi.djait.k@gmail.com> To: jic23@kernel.org, mazziesaccount@gmail.com Cc: krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Mehdi Djait <mehdi.djait.k@gmail.com> Subject: [PATCH v2 2/5] iio: accel: kionix-kx022a: Warn on failed matches and assume compatibility Date: Thu, 20 Apr 2023 22:22:02 +0200 Message-Id: <b6cb3d48ab9e4177b924b18e27487f8ef763dfd6.1682019544.git.mehdi.djait.k@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <cover.1682019544.git.mehdi.djait.k@gmail.com> References: <cover.1682019544.git.mehdi.djait.k@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763728210782318253?= X-GMAIL-MSGID: =?utf-8?q?1763728210782318253?= |
Series |
iio: accel: Add support for Kionix/ROHM KX132-1211 accelerometer
|
|
Commit Message
Mehdi Djait
April 20, 2023, 8:22 p.m. UTC
Avoid error returns on a failure to match and instead just warn with
assumption that we have a correct dt-binding telling us that
some new device with a different ID is backwards compatible.
Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com>
---
v2:
- no changes, this patch is introduced in the v2
drivers/iio/accel/kionix-kx022a.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
On 4/20/23 23:22, Mehdi Djait wrote: > Avoid error returns on a failure to match and instead just warn with > assumption that we have a correct dt-binding telling us that > some new device with a different ID is backwards compatible. > > Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com> > --- > v2: > - no changes, this patch is introduced in the v2 > > drivers/iio/accel/kionix-kx022a.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > index f98393d74666..70530005cad3 100644 > --- a/drivers/iio/accel/kionix-kx022a.c > +++ b/drivers/iio/accel/kionix-kx022a.c > @@ -1038,9 +1038,7 @@ int kx022a_probe_internal(struct device *dev) > return dev_err_probe(dev, ret, "Failed to access sensor\n"); > > if (chip_id != KX022A_ID) { > - dev_err(dev, "unsupported device 0x%x\n", chip_id); > - return -EINVAL; > - } > + dev_warn(dev, "unsupported device 0x%x\n", chip_id); Just a 'nit' - no need to re-spin the series for this if there is no other changes requested. Maybe a slightly better wording here would be "unknown device"? If I am not mistaken the code proceeds because device is assumed to be supported. Jonathan, do you think this change is worth backporting? If yes, then we might need a Fixes tag. Acked-by: Matti Vaittinen <mazziesaccount@gmail.com> > > irq = fwnode_irq_get_byname(fwnode, "INT1"); > if (irq > 0) {
On Fri, 21 Apr 2023 06:44:28 +0300 Matti Vaittinen <mazziesaccount@gmail.com> wrote: > On 4/20/23 23:22, Mehdi Djait wrote: > > Avoid error returns on a failure to match and instead just warn with > > assumption that we have a correct dt-binding telling us that > > some new device with a different ID is backwards compatible. > > > > Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com> > > --- > > v2: > > - no changes, this patch is introduced in the v2 > > > > drivers/iio/accel/kionix-kx022a.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > > index f98393d74666..70530005cad3 100644 > > --- a/drivers/iio/accel/kionix-kx022a.c > > +++ b/drivers/iio/accel/kionix-kx022a.c > > @@ -1038,9 +1038,7 @@ int kx022a_probe_internal(struct device *dev) > > return dev_err_probe(dev, ret, "Failed to access sensor\n"); > > > > if (chip_id != KX022A_ID) { > > - dev_err(dev, "unsupported device 0x%x\n", chip_id); > > - return -EINVAL; > > - } > > + dev_warn(dev, "unsupported device 0x%x\n", chip_id); > > Just a 'nit' - no need to re-spin the series for this if there is no > other changes requested. > > Maybe a slightly better wording here would be "unknown device"? If I am > not mistaken the code proceeds because device is assumed to be supported. > > Jonathan, do you think this change is worth backporting? If yes, then we > might need a Fixes tag. We haven't backported similar cases as far as I know. It's fine to request it explicitly gets picked up for stable if we decide we care later. I'll tidy up above if I take this version.. Jonathan > > Acked-by: Matti Vaittinen <mazziesaccount@gmail.com> > > > > > irq = fwnode_irq_get_byname(fwnode, "INT1"); > > if (irq > 0) { >
On Thu, 20 Apr 2023 22:22:02 +0200 Mehdi Djait <mehdi.djait.k@gmail.com> wrote: > Avoid error returns on a failure to match and instead just warn with > assumption that we have a correct dt-binding telling us that > some new device with a different ID is backwards compatible. > > Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com> > --- > v2: > - no changes, this patch is introduced in the v2 > > drivers/iio/accel/kionix-kx022a.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > index f98393d74666..70530005cad3 100644 > --- a/drivers/iio/accel/kionix-kx022a.c > +++ b/drivers/iio/accel/kionix-kx022a.c > @@ -1038,9 +1038,7 @@ int kx022a_probe_internal(struct device *dev) > return dev_err_probe(dev, ret, "Failed to access sensor\n"); > > if (chip_id != KX022A_ID) { > - dev_err(dev, "unsupported device 0x%x\n", chip_id); > - return -EINVAL; > - } > + dev_warn(dev, "unsupported device 0x%x\n", chip_id); Try building this ;) You have remove the closing bracket but kept the opening one. Jonathan > > irq = fwnode_irq_get_byname(fwnode, "INT1"); > if (irq > 0) {
Hello Jonathan, On Sat, Apr 22, 2023 at 06:28:33PM +0100, Jonathan Cameron wrote: > On Thu, 20 Apr 2023 22:22:02 +0200 > Mehdi Djait <mehdi.djait.k@gmail.com> wrote: > > > Avoid error returns on a failure to match and instead just warn with > > assumption that we have a correct dt-binding telling us that > > some new device with a different ID is backwards compatible. > > > > Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com> > > --- > > v2: > > - no changes, this patch is introduced in the v2 > > > > drivers/iio/accel/kionix-kx022a.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c > > index f98393d74666..70530005cad3 100644 > > --- a/drivers/iio/accel/kionix-kx022a.c > > +++ b/drivers/iio/accel/kionix-kx022a.c > > @@ -1038,9 +1038,7 @@ int kx022a_probe_internal(struct device *dev) > > return dev_err_probe(dev, ret, "Failed to access sensor\n"); > > > > if (chip_id != KX022A_ID) { > > - dev_err(dev, "unsupported device 0x%x\n", chip_id); > > - return -EINVAL; > > - } > > + dev_warn(dev, "unsupported device 0x%x\n", chip_id); > > Try building this ;) You have remove the closing bracket but kept the opening > one. Oops! I will fix this :) -- Kind Regards Mehdi Djait
diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c index f98393d74666..70530005cad3 100644 --- a/drivers/iio/accel/kionix-kx022a.c +++ b/drivers/iio/accel/kionix-kx022a.c @@ -1038,9 +1038,7 @@ int kx022a_probe_internal(struct device *dev) return dev_err_probe(dev, ret, "Failed to access sensor\n"); if (chip_id != KX022A_ID) { - dev_err(dev, "unsupported device 0x%x\n", chip_id); - return -EINVAL; - } + dev_warn(dev, "unsupported device 0x%x\n", chip_id); irq = fwnode_irq_get_byname(fwnode, "INT1"); if (irq > 0) {