Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp173685pxb; Mon, 13 Sep 2021 16:15:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvVEbhybChSzRTunVCS5WVFBmjQYLTPAk+b53PmIc5PztEgKSuMuzArfTLq5bY+Zon0NVj X-Received: by 2002:a05:6e02:1044:: with SMTP id p4mr9975951ilj.227.1631574945061; Mon, 13 Sep 2021 16:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631574945; cv=none; d=google.com; s=arc-20160816; b=pFNjizj/fNyi1jeZuPId+uxk9sEzegzXF1f1BrXIO4qWMHHhqKwEd0VLqOshwm+DBf 7R/UmhWdD9Td0Lj13M8KeVbOVkom46+EE1PdTkePbeLgTH6hnEXZea9V9dnPOm71mNqN uatkmNrZBiHtILnlqbDEPmlpj2cy3PXlZb1uvqiOR5fL5t8d7DvefEum2aOh61gjha8Q hmbZnBm+dH3eB9erCwpbtinxOQQ3D1pdxgoluXbiT4zGxqJnEaZ4rNW0EyiqWLOdw7de 9hyrp7HuLrcsKdedSp5coVVb3WJbQusNeb1cmE0/Awfpx665gOQMBue0ALDvfb0woegI zL/g== 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=RUqWZ1bDLx3fmleQuZUEUjhCKlRcg0qClXOlA9Y8/n1M+g6SkR1ENcQwcdoEhrKagr Gz0w4sIyht5BxQqYuJ+UduZq7QrZxPlDSs+glvZU/iSMcrYu+XGmqtpt/xz8cedp8j+O iD3oFTu7JXMA9Yr49EUBECwORNV6JbNuFUz+vmszpjUvax5Uf4yqpCiHKLUKBnl4O/Ew beooz1RhNZJgO52PIOxNy6CL2XL2Rr0M057TKRwlAr2goSKV3tBdDRy5i6gsLDhiOG8X Uban9Uf5O6HADJyFyvLgpZjXQA9SC0Crzkp/haBIBs4ivr4AuM6/oYi9L/7RpXGMixcl rJ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XSSoHouv; 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 15si9157957ilt.96.2021.09.13.16.15.33; Mon, 13 Sep 2021 16:15:45 -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=XSSoHouv; 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 S1344386AbhIMOqE (ORCPT + 99 others); Mon, 13 Sep 2021 10:46:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:56370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346990AbhIMOkK (ORCPT ); Mon, 13 Sep 2021 10:40:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91DF46124E; Mon, 13 Sep 2021 13:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541339; bh=lnBHHFRuLJzQHrYQ4bLpSlqqObR463nOfp12ypBvfNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSSoHouvvRJ/pEAw64wNXhf4XLc+ogR15Xsny+37pMQzAv8rlJ8XUDOKc6kOd2JRs qzp5eaRp0xq8P0tfgZoWMbegK/Qf1mv8Fj4YdghlgCug0rSxx/nRXwIEFJXqdF378r KPllvE7krbc4UMZhba+hnW54Gw8fMs4pCZmA+vgM= 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.14 258/334] i2c: xlp9xx: fix main IRQ check Date: Mon, 13 Sep 2021 15:15:12 +0200 Message-Id: <20210913131122.130319407@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@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