Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp91803pxb; Mon, 13 Sep 2021 13:51:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAQqibapoKcQsL4HXPy+8+HeEVnWlDzT3pCwZwaJL04JsEwIM9y4ErVv8j7nHOrP4WMIw0 X-Received: by 2002:a17:906:27cf:: with SMTP id k15mr15474854ejc.123.1631566266609; Mon, 13 Sep 2021 13:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631566266; cv=none; d=google.com; s=arc-20160816; b=u8+kWRemJLrBsL3V1PrTreaHSGD5q/JJ8iiIyX1dpQU4hXKkBkO7X4hvdEIfh/1JPb IvvOIA2kkXNJSmqeAK6RAS5d+trw8XcGcZWA+PMFdnyIKM1aijc3Ru0NYyh5e3LqgJRv oelb56yrhsQiqnDVDflxFPEwmPLgoCOgE51YfQElR1m7I5JIuj+7CLJlnKzDR5wlw9WV k+X142nmD3PMfAbWNR6N/YxiSIuqE0P38s1zqNdHH5FPNNwAmK3WP2NByb7oxrmgEThB KDVgvHeKC0gropqpIo5kxkBZwCKd68DbHowtEkTDA9if+Y63QHgnq6EnUnuAQnV1Ae5x cmOA== 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=dGBXQmAER78sDZvyk45g4RoCjz0yefrkgV/t81iSkVQ=; b=ksLauPlHvmhX0frYhbxEIfl/gddaQKdeyuJKkoDMkO49Jo0quxHyGISlFczCjSMzwl Js3KRNzaGK7wVLd2Tfm0BSwrqSeTBV20n2zxFAovj6kCn1aqWGeYI/suQWRy0xYOHTvh 8a0pxQ8opdGtGsdVya9Ci49GZITcEd41DZL3sKXY2CAJdMK1XEeDjwSxDdevJNvuHdyq sKztUHtWQeQ+t9f/aHFS8p2NhoCRyjsykxciwctW3zdmSpd36x/q/TUNhq4WODmDwQBY lktVJgegN8riFB29tsJPbEilMppz8cK2Z/4eFiVpXVy+O9bqkcgYqv/rtqqbsA7QZzEe XHOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z1O8HkM7; 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 og48si8142221ejc.686.2021.09.13.13.50.33; Mon, 13 Sep 2021 13:51:06 -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=z1O8HkM7; 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 S242089AbhIMNs4 (ORCPT + 99 others); Mon, 13 Sep 2021 09:48:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242817AbhIMNoM (ORCPT ); Mon, 13 Sep 2021 09:44:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 828476147F; Mon, 13 Sep 2021 13:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539865; bh=serSkYcvWgyoriQ4hhuKJQuWvX6zkIPe6u50z9O8mJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z1O8HkM7O+2Okqqd/PwQcS8yptypzHfSBdUDC0yEbWosllGUAZdy1xApnEAEdi37B k6Mv105ycKkEsqTJRhgbOnb+pQ2hvy3DdpoF2ctRpSS/OlloJbad56AK/II/KXfDXY U49NyPtD2JFgvXDsz/4LPGRB2t9pcimsvG+NjGC0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , Qii Wang , Wolfram Sang , Sasha Levin Subject: [PATCH 5.10 191/236] i2c: mt65xx: fix IRQ check Date: Mon, 13 Sep 2021 15:14:56 +0200 Message-Id: <20210913131106.880229952@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 58fb7c643d346e2364404554f531cfa6a1a3917c ] Iff platform_get_irq() returns 0, 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: ce38815d39ea ("I2C: mediatek: Add driver for MediaTek I2C controller") Signed-off-by: Sergey Shtylyov Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-mt65xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index dcde71ae6341..1a5f1ccd1d2f 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -1207,7 +1207,7 @@ static int mtk_i2c_probe(struct platform_device *pdev) return PTR_ERR(i2c->pdmabase); irq = platform_get_irq(pdev, 0); - if (irq <= 0) + if (irq < 0) return irq; init_completion(&i2c->msg_complete); -- 2.30.2