Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5635948rwb; Tue, 1 Aug 2023 06:00:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlEmEFxwUetTOoq8OR5akVHbS3MpkfU36F5ZeczGrSRTSjYlQFC7m+9SMMZMjWJk/ePS9R/L X-Received: by 2002:a17:903:1ce:b0:1b6:ab53:c7a5 with SMTP id e14-20020a17090301ce00b001b6ab53c7a5mr13967530plh.46.1690894816722; Tue, 01 Aug 2023 06:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690894816; cv=none; d=google.com; s=arc-20160816; b=K+A2W/zSQsaLGx9oI26UyS6W+TDRaytVPkTZTpQoCndWM/3F+FvZxSwO58BMFi6MEm N+hSMtXrH+QyPQS/kBbt1nJUPu8LQLyc+iTYGevE8FnHcoYKNPuNsyXx2v+4zBEnAsPb zVFWmnFoaW0hJzpihjphNtMnaJgu7Ct7Vt53yDJtKG+qq+AMDvHh+cfMe6Fap36NcG7q dU5dDWBAAPb6cI4SoYiBlM6IpZORA+NzsZm6J2cbbmMkGLjNYNky/JtoW/8qNW5gwdV7 rufNVrQOQB6vm8MJTeP6ieHbrbfYghjn2BYQkF/FwObf5TycxdHWb4h+inLdSqPwtVcO 5vRw== 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=s2FjbYEwYSQTRx95ARkE4igv1HNA98Re6gC6tnSqpe0=; fh=OFrOxlffRSniQgOoitHdExyYxkvf2QkWGZhpq+o0yNo=; b=tlVLmVHgXTwXerch97+X4RS48nFif/KKhLRH69r53OGZvCundHmC926h2rpeaXU/ne 7Yhq5HTpyLHiitBQdWyEl2N6b6CN5NFNfpe1Swe8QKa/K+FXKGPxFBKX8y6nSeTiDbht WKhRlyyh15yuvRB/W7Tov5FPsWuTrct6jCHwCu88CegGrC241WnB8FY275moRdN5w1Xt XyOoDZrIMQUJVJH0KsjdDB5j1wFqsiqQUkgRGKLmIyDNh+4Xpmm1w/4UN8CPeEF3gwBg 3z8U4+JQRxNFbl28iA4dUMRXYPcukPnJ1ZECFGbTiLhgd/C8yP4KT+gymee+LbIRNGQm l2ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=LTrajoxp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a17090282c300b001b9c61c221bsi11184plz.565.2023.08.01.06.00.02; Tue, 01 Aug 2023 06:00:16 -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=LTrajoxp; 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 S233075AbjHAMEj (ORCPT + 99 others); Tue, 1 Aug 2023 08:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232224AbjHAMEU (ORCPT ); Tue, 1 Aug 2023 08:04:20 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DC92130; Tue, 1 Aug 2023 05:04:13 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fe3c7f16bbso2599385e87.0; Tue, 01 Aug 2023 05:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690891451; x=1691496251; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=s2FjbYEwYSQTRx95ARkE4igv1HNA98Re6gC6tnSqpe0=; b=LTrajoxpgDtUfizhJQgA+9IYKFAwZqwY22SfSeX/lkDJeGZl8yRJ+H/kWtYqTh6z+5 QMs765/iNCrSq3MmY5amDQKrQgR1vh3c0V3g/nZ+T4Rpy1alxkOTlmbO2Z8kYoLZjMZh V4BQNc+jxQ1jVpYWX6ctz2VQVCuFQqpvm6kAcmoybM2Npzu5OtUV3dsP8SFk1FCPGoZP KUnNeUXqb4RqcDxYqxHvm94P16ZvLX8MuzYhDhpiXGCkMYvGCFwg3JuVYbew3g+PflSS XttpDUZUhqrqYHe/MRqw1wdsB0Z1adbKUx60Y/I20lBupyyyGEtyGhBs2+fEpbnSc/y/ njCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690891451; x=1691496251; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=s2FjbYEwYSQTRx95ARkE4igv1HNA98Re6gC6tnSqpe0=; b=BTG2lfr63vf3Fw4LvjwMNQbR0an6Ii7QhdyvHOy1OJsWd901Z6rCPaCNMVvfH/2/js O1+OK8ZJua6UBZswcynzDRIaIiC/18UwwmeCILY9neVCESeYnaTTLdrcSe4EmEQWxBAQ 7HgYrj8wrofvBP3VxF/55CrYhk1MdwQMvQD3F3eb/FJpepoEC7rjCla5mMaW7ctdpZZx v0TPSEQJyyDjCzLGwE0sE108EXry/+mWm1e/NNTPB+XSVL4Cps29l283KmkMt6KAqpIQ 9xq04t4ZdglcW5dLX4Ar/Rvahf+jPqNC3QzIXuakFbXQsYsOyTh0wl9LgmIuU/mfnHem 91mA== X-Gm-Message-State: ABy/qLbwNkh1R1Uypo7bePRLKQwobwjFo3I7YSs6KZ0haTQNfQPk798o 34IBTL9wrvnOD6tXwm7oYY4= X-Received: by 2002:a19:915c:0:b0:4f8:5e8b:5ec8 with SMTP id y28-20020a19915c000000b004f85e8b5ec8mr2000288lfj.9.1690891451609; Tue, 01 Aug 2023 05:04:11 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id x17-20020ac24891000000b004fe1960dd7csm2408074lfc.132.2023.08.01.05.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 05:04:10 -0700 (PDT) Date: Tue, 1 Aug 2023 15:04:07 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 6/8] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t5IIdvlUffOw7YI0" Content-Disposition: inline In-Reply-To: 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_BLOCKED,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 --t5IIdvlUffOw7YI0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The fwnode_irq_get_byname() was changed to not return 0 upon failure so return value check can be adjusted to reflect the change. Reviewed-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Matti Vaittinen Reviewed-by: Jonathan Cameron --- Revision history: v5 =3D>: - No changes v4 =3D> v5: - Added back after this was accidentally dropped at v4. The patch changing the fwnode_irq_get() got merged during 5.4: https://lore.kernel.org/all/fb7241d3-d1d1-1c37-919b-488d6d007484@gmail.com/ This is a clean-up as agreed. The return value change did also cause a functional change here. Eg. when IRQ mapping fails, the fwnode_irq_get_byname() no longer returns zero. This will cause also the probe here to return nonzero failure. I guess this is desired behaviour - but I would appreciate any confirmation. Please, see also previous discussion here: https://lore.kernel.org/all/fbd52f5f5253b382b8d7b3e8046134de29f965b8.166671= 0197.git.mazziesaccount@gmail.com/ Another suggestion has been to drop the check altogether. I am slightly reluctant on doing that unless it gets confirmed that is the "right thing to do". --- drivers/i2c/i2c-smbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 138c3f5e0093..893fe7cd3e41 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -129,7 +129,7 @@ static int smbalert_probe(struct i2c_client *ara) } else { irq =3D fwnode_irq_get_byname(dev_fwnode(adapter->dev.parent), "smbus_alert"); - if (irq <=3D 0) + if (irq < 0) return irq; } =20 --=20 2.40.1 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --t5IIdvlUffOw7YI0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmTI9LcACgkQeFA3/03a ocUhHAgAkvkj3Vn65/NMmeq91WR7BQwOaMmyA/Q/vG/UjIosy7wx6dLbeoqIAqrs Pn+xQBcSqUEPsZ936JKdD9pb5w63hDsWMKAewMyhKxGvx5D0po8ydyVcK11Q31Kj s6iGR1rJmKiY+hsk+elW4I9jVdcReVqnYiyAXcGeCTIM+/qfIS/dIuGK02MP0T6w UfAZh1Yxh0Py/ejeKDhe03lyYkvO0piXf0oWLLv98HKtLKlOBncpnvhYTM0IWMCC OZ6Fa5cmYEg7Uez8gvCus9oj4gFsCcVMbItbdpImQAGGgJZ2L2YW78gmW9Cxonuz KHFsG8dl+RBj8pTnlFC5w1xH6BFPAg== =fNKQ -----END PGP SIGNATURE----- --t5IIdvlUffOw7YI0--