Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2322445rwd; Fri, 19 May 2023 04:19:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48sBxye21xOUhuEDpwO57qtVxnOWF/7WqnAOGQ2WpgURAUBcKf9dakk+jACEIPUkZDGdOy X-Received: by 2002:a17:902:ea8a:b0:1ae:2b95:7125 with SMTP id x10-20020a170902ea8a00b001ae2b957125mr1748420plb.63.1684495147736; Fri, 19 May 2023 04:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684495147; cv=none; d=google.com; s=arc-20160816; b=NF9fO9yus0A+YDEaupf+Ih0Rx7WtD5aGUQBkS2UyaN6CjukqczlO3lV4OJnM6wiq+g PSkrbxIFurgOgLMmO6QlaHHx89DCVVcTeyVAGQYaQ+1s0mmn2HcQC30QIlXJqPgeXoKY 5d+98851QttrGLHzWvT2eC22Wn5xUkK9cIU7OQPyYYfbsNPkEl2/Wus3e2aMY9RZDgqH SMvvye/FswOlsfzAAn8dF9e58e/QDnUG5CWSt+jpKYFSaF5844Kw8LlbhGmNcRSCg7NU rX6+BVCpVpEZykaMAkXeDQGAp/60IItnvMzMTJIfjCkJLhL0eCm2kpgGhZJK3o5PvBg6 gRNw== 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=P378hHq4N3JMZZ8BxEOLVTa4riUu6d9EihNhy7E+0is=; b=KsHGkL1zvSFvNZk3uDt04YU3vR5niVASbDtEIXiSrOKBiLN3q5ejv++U95WkqJFK1n KUxPPaUMt0UVLF+ikcvVRWDJYThbAP/Xw4JYe+VzrkZlguLisbqL+4PGLppUt25RoNeH /28UdffpwSJ1s1thiJDpbq+N5/tLDxx3XN1eGoOASM9DzyQwXGALEQj0402K039Him19 sNYvWqeU2yAipOpEgRDGsPR4PSNWNyv4QdhUcnVgDRQj5dwzDbvrI0RmnkA+dc7iseeD TaDffPVCkCTTnq13y0vXss/m165sH1u2jCOYqpB+OCaGrYWF329cQ/ONoYuulCJug0sD xVrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=k+2XNk0H; 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 m19-20020a170902bb9300b001adc3a1b3fasi3168518pls.282.2023.05.19.04.18.52; Fri, 19 May 2023 04:19:07 -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=k+2XNk0H; 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 S232019AbjESLFp (ORCPT + 99 others); Fri, 19 May 2023 07:05:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232014AbjESLFl (ORCPT ); Fri, 19 May 2023 07:05:41 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D3EF1703; Fri, 19 May 2023 04:05:11 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f3a9ad31dbso1476735e87.0; Fri, 19 May 2023 04:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684494309; x=1687086309; 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=P378hHq4N3JMZZ8BxEOLVTa4riUu6d9EihNhy7E+0is=; b=k+2XNk0HnwQQAxOVF60+teE75k+Oj1fbP4St1f+fNi9cPlQvvAa1J7TqhcjTWlzH/g XG9ZHc1K25RU1Z2jAthkQxW32TOA0r0VKqB1R89ErydtnGmfn1TwEiZmV84AHJ4K7DDc wDGeF2AbWDX48vdZX0bmD3m5F/rdbWLfNAsLwQIE56SwX6i0RFbx2zs+UZZz1SFuh38/ fr+3saVisOrzNYmRaH3U0PKy2k77E7lSo8NzJDVVLlMroZh6e+45Kq3T8BGhgLV4Grqd unY54kOrYcw1BRKjB2RlBovdHKyduBMVCznG7mi6Qb+1J/v8m4Xh7uVYgo8PUBejE2FS VB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684494309; x=1687086309; 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=P378hHq4N3JMZZ8BxEOLVTa4riUu6d9EihNhy7E+0is=; b=TtpmUWK+DSteo2P2n32nSQusc6dm0DzsQc/Zq+Aq0pLKw6bIsPfDTI9P5U78XHGOFo I7t8V7whfBZ5mg+S25SQaxzqiIGHFYEu3YMyvRYXVqnh+p7qRnmSKYr2fGMefpWOU6y0 JluA2A4OxR0rJh/hhzAmWdMdxCo/xHlMKsZeOAmTODfn+F6BeU7EHLmfEwC5y9YgRUXZ u9SEpmDH5lf1IJO8y8rpRSoGrligczf9a9jEuFSAiFw6pJlhWTRVa0XPMfsucVw75tCi NUB2pkRmfFCwbjfgyGIrm7SSkx4uJTbe31S2wY8OTEt7LlYs2Gqg+HSAs1YZkT4ZifHe dx5Q== X-Gm-Message-State: AC+VfDxqnvzhcKYursM4JGiUdFvLSx4RUNKqesDxKHNEbD2fIte5KBJa 5tkf/R+gRGNlMBEXrkRoo7s= X-Received: by 2002:ac2:4f8a:0:b0:4ec:8853:136 with SMTP id z10-20020ac24f8a000000b004ec88530136mr648825lfs.12.1684494309113; Fri, 19 May 2023 04:05:09 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id y3-20020a2e7d03000000b002ad988efd73sm783732ljc.14.2023.05.19.04.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:05:08 -0700 (PDT) Date: Fri, 19 May 2023 14:05:04 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?iso-8859-1?Q?Neusch=E4fer?= , Linus Walleij , Paul Cercueil , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v5 8/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="cERw4jF3C6RL21eM" 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_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: X-Mailing-List: linux-kernel@vger.kernel.org --cERw4jF3C6RL21eM 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 --- Revision history: v4 =3D> v5: - Added back after this was accidentally dropped at v4. Depends on the mentioned return value change which is in patch 1/2. The return value change does 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 --cERw4jF3C6RL21eM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmRnV+AACgkQeFA3/03a ocVUPwf8CgYpr8uh/bwuPx1q9qIB850v05IJYNTncQ0NjKUkuWfwkJD9ycWFIIqD o+m2zsrcSf0nYdZczy6xJgWH0VrjZ1Klt7HW+NkNj7u6jsumWV9BdPAMOHHEQhKs 6sdm+Bvxms7xfTV7HgZRlDfOONfNo0KRXDneniek+OhrEstbHI1qy3XFVWbyo+ay 9xNgauhmaPbCVn+IX5hsgJIbvFDgYtF49TZBw9ZKOxAde21vYOGBn+cu4if/DAJv Gb23EgmFnee/eEiMCPYU4CbAOpNChMTSLpw3oJb4kGk6vkOH/8MYerQtHZdVebMn gTw43TKhczVIXtT/t2eUH2GUs/P9fg== =vcE+ -----END PGP SIGNATURE----- --cERw4jF3C6RL21eM--