From patchwork Fri May 26 06:39:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13256488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08702C7EE32 for ; Fri, 26 May 2023 06:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242270AbjEZGkM (ORCPT ); Fri, 26 May 2023 02:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240535AbjEZGkL (ORCPT ); Fri, 26 May 2023 02:40:11 -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 9C4F610D7; Thu, 25 May 2023 23:39:43 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f4b2bc1565so349122e87.2; Thu, 25 May 2023 23:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685083182; x=1687675182; 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=r8WxArmJoZC8xqHylJdU5AGk+XIbCJbogTeDfs0y2fc=; b=kZlxofiucY8/Lfp0amC/THuRlzjVm4QfLqqW0v8XoWvGEazpIcKfv+6Y3Hkn28xoPU QfGXd7HkgrTwQ7CNDgIIxnupjEz612uEqGABVzbMzhsb3UBA2jm0mgt2VHWoKOAuXmsN VoFAX2icB6TKFkhF6SS3ZcDfsVrB95m4IDnEBZKQRCzUMgKrO3rab67HUeLHwPmnbOkk eU6j760c569VapRpeY/+vjs6apRsTp67TJowAAq0MNV7LVC9PoFNzE9UR+PZOD/CuW3p ChtTT4YO9tj+T6H6Cksspq3qsVrEGp/722KN9wUHFz63wiU2cDlaZyUWlHhxkheWZ0DC eYfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685083182; x=1687675182; 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=r8WxArmJoZC8xqHylJdU5AGk+XIbCJbogTeDfs0y2fc=; b=YFA9TIX8E2PH6upJmkKC6t4+seOzjNNIbI3lSIpSBBAaCUiwktzzRYaUtgTbZFXTZt sHYzTxwnJOd6dfysK4sx1/vHDDJR7WlZdmVUPkprG7FMUmbvSsEGmyYi3eHVoresdeMy jlyJFUThzZdYnKXiKY80/iF/q94osJEDAkbWOuBt3Px8xIzWKXTX3eoaWDf8fWNg3dgP f4/AR8toZDRDUcYxG1DyLHbL1VPQuVL64JB6mKQ/AB8zp8TGLFNVyLHX/EpbM5cAy3kD ksMxS/oQ56Q4X+zL5e2mKbSy4Yh7hWSP3xLwgCu/LK666xrjMQTZXvcN5JCmkTWjd/u1 fXeQ== X-Gm-Message-State: AC+VfDx9Sz/Tzh85iQLtm0Ye2fhRMzhx2T0gmaPsTQjjTMFBacU2Mk0A jZcBEOnIlHVpSi8FzGyd62Y= X-Google-Smtp-Source: ACHHUZ7suqP34B7zhh7d+MVDHYwTRa3XCDJTVoRDJ3idVkc5oKu76GbAuL5+UGbLruSq7U8YqZfIpQ== X-Received: by 2002:ac2:5deb:0:b0:4eb:1361:895c with SMTP id z11-20020ac25deb000000b004eb1361895cmr168335lfq.55.1685083181695; Thu, 25 May 2023 23:39:41 -0700 (PDT) Received: from fedora ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id a22-20020a19f816000000b004f3789c8bd5sm488291lff.132.2023.05.25.23.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:39:41 -0700 (PDT) Date: Fri, 26 May 2023 09:39:37 +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 v6 8/8] i2c: i2c-smbus: fwnode_irq_get_byname() return value fix Message-ID: <1c77cca2bb4a61133ebfc6833516981c98fb48b4.1685082026.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 =>: - 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 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". --- 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; }