From patchwork Tue Aug 1 12:04:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 709017 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 6E102C0015E for ; Tue, 1 Aug 2023 12:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234277AbjHAMEi (ORCPT ); Tue, 1 Aug 2023 08:04:38 -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-Google-Smtp-Source: APBJJlHghj6Ntuc24CM32xjyPHGp4G2F6BLMTq9uNq7xqF8EYmL0MaCmratdBGH+k2Mwy5MdTPLp6Q== 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-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-i2c@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. 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.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; }