From patchwork Mon Mar 6 02:45:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongliang Mu X-Patchwork-Id: 13160387 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64851C678DB for ; Mon, 6 Mar 2023 02:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=aHJBYn/PR0zU0S3ilQmO0VRBpdNqSQJZdCNFzboHNs0=; b=tJF3s8qMotU9Y/ ac0Fff/IrjLXN6zK0iWSM1BZzeb13uXRQLequDhVAhyswH/QKsKBFdzBQ1GTRXuUCZsVFzxsEWwCe mkFqALaIdx4/3XHLxd6CztT1ReZi8Wd5G1uAxuZM5/kXgyof3OTT5qVY00iZMLjFxybiqcnjQHz7T guz1Ko1O0dvzCF9QevLm1/cZP4FlZsu3Xi8S229havc/CNfegrImVn+mXTkNxNcz1vcuyP3X1ghnM IwibCrntcFbvD9iEebjQ8L9mb9hQgzKcfvk5R3/45GKRs1UkIwBPoNkLsK4XzOZKFIgVwFnAjFuy3 Ns96Z2b5fixuTsxD97og==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ0uY-00B0q1-9D; Mon, 06 Mar 2023 02:49:14 +0000 Received: from mail.hust.edu.cn ([202.114.0.240] helo=hust.edu.cn) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZ0uT-00B0oT-OE for linux-arm-kernel@lists.infradead.org; Mon, 06 Mar 2023 02:49:12 +0000 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 X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230305_184910_184756_5CBD540D X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Bartosz Golaszewski --- 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);