Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2190720rwd; Sun, 28 May 2023 09:54:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xSxGCmP4VeFxXn7T9KfDVp4j3+WeDaqbfFczgNmzXwuHGiGuKAt+ifpEG9zCp67ttkpTQ X-Received: by 2002:a17:902:aa83:b0:1ac:874d:f55e with SMTP id d3-20020a170902aa8300b001ac874df55emr7729120plr.22.1685292886244; Sun, 28 May 2023 09:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685292886; cv=none; d=google.com; s=arc-20160816; b=xDbqfw51UvEli3ezdz+I2X/5tfH/wnkapDRZgKIjx+2WEPvd40cYSC2+IfZO6bT/LX gm2dLiIUcCXjrR1IzqWA3gumORiw2fUjVAbfwWiUxZvVRrSYTPzmdEpCQceD32N5HU2n 7aALiyNtYY9r8DEecJOtl2ySGlDriqbrqLnbCHnWqNG9y5dTYRxDEQ5xDakNM5vmdj9b VnQIyxDtFyM6itRcRnJP6ncE7Dp+ty6FIf9esLzKGCI7AEGJwefUrurBRfhxUUJr945n yUz9Y+nUQxCk3mIY/igqsl0edWNlthhwzE9I4sUO4dCOzPNSTUjZuVMgvuewwmbkXzN/ hdHw== 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:subject:cc:to:from:date :dkim-signature; bh=mOfkF2K+J2IBw0tdmpsRPzFy6iON+Wq0ZUXeRun9Has=; b=cSNcRyhDybPTr8TdEv5Er3QcJa8qnxiKF/FeILdJnpjIw6nXOEnseTDkz8dnKEX3v8 r7qtVP4ohbXACUj8WblBW/mRrC9siclneyCHlyG4GH99DK3FbxSQdhF/1//32HXMss1t OptkJlcmVKV36HA7o6rPYvhUu4Q0hpQMS5pt3qpc16MsnN+wK1iyJ7pd9i2B43bLlimD supqRL+Tr5hgWwAiin76kf0BXep3aIR17LEVvh67tq4KW92NUW0s1Eip+upnUlpA0jHc xpsv0ab7G6yK4ZZ+fo7pmWCgkt3iqfMhWxpqu3f7wJ+937BPjor13izUF6ou+XfnQa1Q y75Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VJ8g/zHW"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a170902b20800b001ae5fcecb49si3404233plr.25.2023.05.28.09.54.32; Sun, 28 May 2023 09:54:46 -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=@kernel.org header.s=k20201202 header.b="VJ8g/zHW"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229686AbjE1QxB (ORCPT + 99 others); Sun, 28 May 2023 12:53:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjE1QxA (ORCPT ); Sun, 28 May 2023 12:53:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35DE0A4; Sun, 28 May 2023 09:52:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C6987617CF; Sun, 28 May 2023 16:52:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31091C4339C; Sun, 28 May 2023 16:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685292778; bh=6jBv9EQ5KlhNuW31yKlvrcZi5bUWsf/LRvMi5CHoiXU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VJ8g/zHWPYXw+S0eqeDnxPNxS0xOVgaBdxj2w9sSfeqkeitzhpd36Kv7pQHZAcq+h pFksfue84kTUydLxY+VgPpCeIJ2teUM1ouUWWNMom3XaCxOKaEt8OsBFK5680j1n2o kFDAE7FsC94GZRI0wQIZBNf6KQDUEl/spEGFiuqx8gZQ2MY0FKOQKoRwGUbCXjZl+V oiOE9kBu87CJzV0v6QLxWqxVFz//0RepGcEtKBlUljMktEL/H7SavzCLrYiB/E2S3N rhpXUI4sP21pS8drxwTO3qb0Jr//owAj3hogN2gGumnmLCV9/RmxEmW/sCU3vmB9IU lGSTNYkTFXEcQ== Date: Sun, 28 May 2023 18:09:13 +0100 From: Jonathan Cameron To: Matti Vaittinen Cc: Matti Vaittinen , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Wolfram Sang , Lars-Peter Clausen , Michael Hennerich , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan =?UTF-8?B?TmV1c2Now6RmZXI=?= , 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: Re: [PATCH v6 8/8] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Message-ID: <20230528180913.21493d80@jic23-huawei> In-Reply-To: <1c77cca2bb4a61133ebfc6833516981c98fb48b4.1685082026.git.mazziesaccount@gmail.com> References: <1c77cca2bb4a61133ebfc6833516981c98fb48b4.1685082026.git.mazziesaccount@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Fri, 26 May 2023 09:39:37 +0300 Matti Vaittinen wrote: > 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 Comments follow though... > --- > Revision history: > v5 =>: > - No changes > v4 => v5: > - Added back after this was accidentally dropped at v4. > > Depends on the mentioned return value change which is in patch 1/2. The 1/8? Or just use 1/N and you never have to update it. > 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.1666710197.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". I'd be more inclined to also fail in the setup->irq < 0 path and drop the later check on basis I can't see the driver doing anything useful wtihout an interrupt. > --- > 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 = fwnode_irq_get_byname(dev_fwnode(adapter->dev.parent), > "smbus_alert"); > - if (irq <= 0) > + if (irq < 0) > return irq; > } >