Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1846389pxb; Mon, 13 Sep 2021 06:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6lB2YIpk+R8Qi/7TnHfCprP6135eXPX6Bpk+lTY+QTQQWscWLHTq9HyViagjNVzb8hxZ5 X-Received: by 2002:a05:6e02:154e:: with SMTP id j14mr8346011ilu.226.1631541002351; Mon, 13 Sep 2021 06:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631541002; cv=none; d=google.com; s=arc-20160816; b=EkicXjOWbXS27SOxKNGX6qLOTrDWz+YZXq11h/aGZ67+OzVFeuJHyrASmEGC/uZ3s3 PRmaeHVyEOiXKMJRZ8Kdq9UK7aQlevtp0BVx29cDxNDpe8lpuiR6mC8JgSkF3EHhdCbG d281n4slvwjYf9R/U8zj4qu2wrt9kjTdVvHsE3ZlqZtj4VKhYEtJ/3SmPCL12XtdqJq2 X/U/GASeqF3b4J6+9bnk6YxPsixo+md+ki6MVXklaHc5RN3f2JfffDVp34tS4U0PD4c8 PEN9vux0BSXQ5JGDC4gDZ5nmcSkgUQQgmAYRFwZUXpeJckPIbRVVuoxUUFmbZXXIMeWr j2uA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3Xz8wBkZRSV2u/PDU5thbgueriLOadCKNVwgtnJo/Io=; b=0ynMW7A5IQX04ZV0wDVWYCdj0ZNpJYqk2dx6tTDr9EOmHet8DTVWVcgK/L7OPZ3VYt wI7nunXy3ZUvp7RFWCNSL2vG45s54qdVuzs2lPvoo0IUY5o4zmpQlYuLPAOeCcvoiomy 5mulCfxKHMIH04eQ/Zosw8tDiBPiDTjtvwRbIpsfpERxNM8h2y2KZHiX5vHaSEk1E3L+ HMQXHEYFfjrR8rIKKz54if09O6tDMY9TrZhChVZspuEqAsIOVS2F+4lWtgpHjATqexQw rJ+6oERPwGU884rPaXbekf7hig7jX4WWPOqjL6JkHHWxJjMMQ8nv8n0mxiXdfhQmt6op 7Efw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ctL4YRYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si7070658ilj.162.2021.09.13.06.49.47; Mon, 13 Sep 2021 06:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ctL4YRYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244128AbhIMNtI (ORCPT + 99 others); Mon, 13 Sep 2021 09:49:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:51540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243610AbhIMNok (ORCPT ); Mon, 13 Sep 2021 09:44:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F347161502; Mon, 13 Sep 2021 13:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539867; bh=lnBHHFRuLJzQHrYQ4bLpSlqqObR463nOfp12ypBvfNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ctL4YRYYzjD3vOSV46pkGRaR+67h+Fcnp4FbsBJmmYRldbAL4TgQbrOWEeZXhewHa ceaRkc/B5vbFMwBvOHR5p582/6eDx15smJ1X6truMy1iVlwCEAaqZAqZ4cLHMqpRqg 0154Cfv+D2Nm6mZZPFBZdrh73Yom8ywWIScXdyog= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , George Cherian , Wolfram Sang , Sasha Levin Subject: [PATCH 5.10 192/236] i2c: xlp9xx: fix main IRQ check Date: Mon, 13 Sep 2021 15:14:57 +0200 Message-Id: <20210913131106.918247647@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Shtylyov [ Upstream commit 661e8a88e8317eb9ffe69c69d6cb4876370fe7e2 ] Iff platform_get_irq() returns 0 for the main IRQ, the driver's probe() method will return 0 early (as if the method's call was successful). Let's consider IRQ0 valid for simplicity -- devm_request_irq() can always override that decision... Fixes: 2bbd681ba2b ("i2c: xlp9xx: Driver for Netlogic XLP9XX/5XX I2C controller") Signed-off-by: Sergey Shtylyov Reviewed-by: George Cherian Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-xlp9xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c index f2241cedf5d3..6d24dc385522 100644 --- a/drivers/i2c/busses/i2c-xlp9xx.c +++ b/drivers/i2c/busses/i2c-xlp9xx.c @@ -517,7 +517,7 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev) return PTR_ERR(priv->base); priv->irq = platform_get_irq(pdev, 0); - if (priv->irq <= 0) + if (priv->irq < 0) return priv->irq; /* SMBAlert irq */ priv->alert_data.irq = platform_get_irq(pdev, 1); -- 2.30.2