From patchwork Mon May 29 06:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 686771 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 0B478C7EE2F for ; Mon, 29 May 2023 06:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbjE2GZB (ORCPT ); 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-Google-Smtp-Source: ACHHUZ7Zh6z2ke5UbYWZOvOrsExI7SxqLEdFdCNeOv4MdD+rb76OPi6JznRKt4oahaSfgpjTXZ1yTw== 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-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-gpio@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/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.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; }