Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1834337pxb; Mon, 13 Sep 2021 06:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi3/SPv9h8ocmaZgLuT/dJbjFbjfKKH7f9rp+BG7HmspGp7pts+TgBfLxw8BptUnW89eZa X-Received: by 2002:a05:6e02:1305:: with SMTP id g5mr7182250ilr.9.1631540100734; Mon, 13 Sep 2021 06:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540100; cv=none; d=google.com; s=arc-20160816; b=MK12gZ8Z7LvAhtju7ZYXp2w9IypoJfcCJFm9vbXd1zSS3KqehU6/MFqOJ7JGroMg3r kSVUxNLuYSVxA3NLK9mh2spu/Ew6iaeqxNDEOeOl/Jd98nvI2RwN7L6Rs6Kh/OaL7ePb rs4slWKGkB/foGXh08y0XWK8SfaTugtd7jbb/Hg96unM5mR0jgal2Vu3bOV75xuzDlAL BllYZNhoULiZrsAlWYjGBiHDLs1v8qeIb5/EJW+kXLC2VxZd3LyBzpklESEk3Ygk9Kpd iRor0vQI3VWAQvpUYDh540/XWZnihZXD+cT4Na06zQEOwsXlw2IHhVoXXptNscDqs7Lc K6yQ== 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=JQL1rr3zjZ0DjgsKxCp8FntWcYIRv226uXpr8BmhhNo=; b=IrSYVfz7uaJ6vHLoVZ2QO//XMAldDLDmjpfDBl1MH4kTEPc6nal10o1s7s2DJqECYa DtNZaVme2jyI4pBv0z2Ch8MvO3TqnfFyha5pigzRdr3B7hPiOMtqTUoVjWZQdsgtGWBB xwsQPvJnfsCnbYh+WZARf/8WJZYJgT+DosUMe2KsuWIzc4JiMtBA+EnYOiwOAbd5y5LK zBDh7FSUX9Kfc1TJOiD80MluNFSEiSbUqUfDBkPlYkG0hzuUiDY9eRwHjJRORE5Qh9Te aBkfkzSw304o8a10qpH2Bn7j48uQoXxsmvaTMqL3KuLZSEbUDmoyIVf1oH/+L+8Jyc6A 8HlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YacdfeWa; 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 q22si6412197jae.93.2021.09.13.06.34.45; Mon, 13 Sep 2021 06:35:00 -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=YacdfeWa; 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 S240108AbhIMNdl (ORCPT + 99 others); Mon, 13 Sep 2021 09:33:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:34834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241299AbhIMNXs (ORCPT ); Mon, 13 Sep 2021 09:23:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25969610CB; Mon, 13 Sep 2021 13:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539285; bh=iOY7Mi7mIXGjAjDRAXnlIHKeuvyco5yoBW9Kg+Y2XbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YacdfeWazSI2UGK7TjMYWgutb2pi2rId+WYgc8EEysmErNnPTzbrzO6YqTIG4IO3C Dil1WFX5ONakDmxFRaAy6EgcddlxFIzBCUWq1uw3Z4IPvH6npJaKVetlNrLhB8NfsK 22Ov3MAxK9fKFLZZTp9+KsIzpth/rXWFK2TUmVfg= 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.4 111/144] i2c: mt65xx: fix IRQ check Date: Mon, 13 Sep 2021 15:14:52 +0200 Message-Id: <20210913131051.652091627@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 e1ef0122ef75..5587e7c549c4 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -932,7 +932,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