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 5C63AC678DB for ; Mon, 6 Mar 2023 02:49:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbjCFCtu (ORCPT ); Sun, 5 Mar 2023 21:49:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjCFCtt (ORCPT ); Sun, 5 Mar 2023 21:49:49 -0500 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE38F963 for ; Sun, 5 Mar 2023 18:49:47 -0800 (PST) Received: from localhost.localdomain ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 3262m5om002740-3262m5op002740 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Mar 2023 10:48:09 +0800 From: Dongliang Mu To: Sekhar Nori , Bartosz Golaszewski Cc: Dongliang Mu , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe Date: Mon, 6 Mar 2023 10:45:23 +0800 Message-Id: <20230306024523.248216-1-dzm91@hust.edu.cn> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From the comment of platform_get_irq, it only returns non-zero IRQ number and negative error number, other than zero. Fix this by removing the if condition. Signed-off-by: Dongliang Mu --- drivers/i2c/busses/i2c-davinci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index c836cf884185..9750310f2c96 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev) int r, irq; irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - if (!irq) - irq = -ENXIO; + if (irq < 0) return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n"); - } dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev), GFP_KERNEL); -- 2.39.2