Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2755142rwd; Sun, 28 May 2023 23:46:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61+q2UCTjY0I20h+s2tQDauhyB05eyyLdj3zTz+l1hf6Y5uXdxJ4WJQgr8NlUYPcf8cX4O X-Received: by 2002:a05:6a21:339c:b0:10b:92b8:9845 with SMTP id yy28-20020a056a21339c00b0010b92b89845mr10027624pzb.7.1685342774725; Sun, 28 May 2023 23:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685342774; cv=none; d=google.com; s=arc-20160816; b=Bl6On96iKy1+MSHj4Kvk52RSgB0ta+HFi6ZJyadtdN2VIQi3DQ34nIwGl0JDuiduQv rwH0Z+wt7LZHtojIcmDDC0RQSYe5iqAcF+mvILOhPqFCLH1XGkK+dE3ITokbHh+I1g5O lN3u5VwYCtvntgfkssJGTgo23HtRSRYAJdXgiAMa0QwLS2yJsRBL7ep1ciNt1tilrqze Yiy+YQqrqhvaApp6bmhslx7BU0EBzis6VxygKqVm7jrB/zra4l9SCn24zhXTO/hs5PXh 0OscQtoNkWSajTIPshCHVu6WSLvBra+E6TnYS2AzIJi1q0Sn/F0eTXhkNbFGM/Fnb7lw 9KRA== 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=gMGKMQ5heIZqIPqdt41yF6tIdWNRsHLiOnUodPGYbyg=; b=a2XcWylzVvaYhuAFcbXWRcjaB/ngYu38XOZ8h0Y07Ox3Ftq8lfdG8ON8qdCH54HWDR vEgJQkd6fQxVzISEmWh9Ewv+bQJF/6OqPk2keR8sM9bMzeBHINRJAdSvPHaRJbKgn8OP pMgm+y5lrWESBq1eCQfiQ3bY+VZYmIqwmeGt6a5LbPJ1QGpRatrFWaS79z+5ccfzh5dT R7tfRFlu+mfkiP8dNABwHDsLv0bto2EOwsXZIoPprvXafu7g9qkWNkceKzjvYbH5Afrg a5k7znZ4QV3nE0kXrPnKbhvQ1wy/elTekVoqcQ6BJt3z+b4gGm5zGlAIMcCXm7io+QZh p/zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=pxhc4f3y; 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 m137-20020a633f8f000000b0051b423d966csi8517238pga.280.2023.05.28.23.46.02; Sun, 28 May 2023 23:46:14 -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=pxhc4f3y; 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 S231594AbjE2GZB (ORCPT + 99 others); Mon, 29 May 2023 02:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231438AbjE2GYv (ORCPT ); Mon, 29 May 2023 02:24:51 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EEF3EC; Sun, 28 May 2023 23:24:22 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f4f89f71b8so1195419e87.3; Sun, 28 May 2023 23:24:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685341457; x=1687933457; 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=gMGKMQ5heIZqIPqdt41yF6tIdWNRsHLiOnUodPGYbyg=; b=pxhc4f3yCvamPD7Ifu2P05204ThyP/GqLYqkRq9erG7F4i888mn2SRGiMB4/jXDDJs mMtR2pdV5Iu319rSLAotcbz3Nvl0JZDSH9LA+kB30vDyQTsSsuUGMtPj93W4q87S+4pC E0HrnmuZEbxpo0J4V/nCB2I+BjSfaQ9S4zbdQlgkdbbUF3KQQcncex3ETuLc/wWposG+ xhgTCu7pFYi+LN6Zp2K5n36EDGKluVAMhJZMA1G/xxf9Ex2gyz9uUQJXb7neWn0VuMMC QaGVz6c4ONzIPiPLnG2o/OIiJ6GBbu/YiHLN6UjmAohe0ekLfI5qAwIqWdiWc1XuABIc eCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685341457; x=1687933457; 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=gMGKMQ5heIZqIPqdt41yF6tIdWNRsHLiOnUodPGYbyg=; b=RTVL6ZcX8FQ0Nf+AIYVa2OKO0v3QDJUVkj2GxFOnVjhu4JeS1LuGEjFNs/Pj8qRwFR YVH7qVfSR/z1O0/92bDJBxLu3Aw9bB6ZFzO+UltzUJIJ38Ye7ADjbqKXSz502EvRlOXE hIiuYHr/WmE8iqw3SCBwrt3Mhr2NuU60hxRtp+U8UkV3hh/2YXNtkTpHUYNfPMaBTFQC PSFKQJ1SSDvGfA50x0MQVgAabjdW/v/apufpOJH5NtTTHZpzHcG1ccX8XvOFWJorccV9 MHVA5+Cosh+ab7X0l+Y2YioimPLt/VBgnh0lREAEeVdxirQCeWXJABdxxmEbKfe5EyAl SgYg== X-Gm-Message-State: AC+VfDzsl0zjX3MYspWHszLPt7CmpUFW79sSHUDfBQxntWG6TaOK3y3y PiUPRHASyTlLSqqd0ZIZq7c= X-Received: by 2002:ac2:4855:0:b0:4f3:b6b8:dabb with SMTP id 21-20020ac24855000000b004f3b6b8dabbmr3311641lfy.13.1685341456877; Sun, 28 May 2023 23:24:16 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id w9-20020ac24429000000b004f4ce1d4df6sm1844987lfl.47.2023.05.28.23.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 23:24:16 -0700 (PDT) Date: Mon, 29 May 2023 09:24:12 +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 v7 7/9] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Message-ID: <73a0af48bffe99a9d4b94b1f986258021eea6182.1685340157.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I7qKH4leGOxrES6S" 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 --I7qKH4leGOxrES6S 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. Depends on the mentioned return value change which is in patch 1/N. 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 --I7qKH4leGOxrES6S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmR0RQwACgkQeFA3/03a ocW6cAgAkc2IQ4oT3YwVX8CdTPI4OMUX/+qJD/12QGLgIlLmpI7lTZvNlcxHq4Y6 1dB05vHijMtOdx5sM/m8HEC2kKnGihOH8yphwjfzjY6tDll9TAlERxBqdRv+R4QD hwMfMnuThrWSHdapSRT66awvr664s7RNzwrO4F6aOn5ZpHxhwXiS9zhDN7ZFOht2 ahl9F1+ddkNs1GpitdycHV6H3m1f+XQEqrKXwnngtD+0qszeCiiR2KgzCH8Z1Fk4 84Y9g0p39Te9UcE7ey52/eIvV4M/xeI5hPITY4B6hSb+1ctK71pqITUDmxgaFvqV XV00SLsoGzTqK7m8Kt5j8cFYAkoMMQ== =+h1W -----END PGP SIGNATURE----- --I7qKH4leGOxrES6S--