From patchwork Mon Sep 23 11:55:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13809531 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 D4CD8CF9C69 for ; Mon, 23 Sep 2024 11:46:47 +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=o3HCS50G76n1T6tRmf9TwfbdIoAkgDzsgBM1R8PF8us=; b=w0IFh99i0NbOoM V9zYPiudo9cyOSthcp6bMFjXbF2CyVrfjEv9Gc+RM+cvp6XhzeWoHsZvw7ij/juxCu330VOXPKMCc nPZ4AYMNVlN+CJ1rrsnovZcxQJO4yprTAKGvplmgFSeUMniWgC1OGL0aMX6cqhUF2bRWtFXo8Zq+0 rjvyqsxRxhRrVsA/2nZvtW4QFVmDq2UVCGQvCNYOYxurH3MOOdo/PBj8XEz4mvu8IXSon9rE9yY3m 7nhd/Gp1M8kWkVK54c2jX4ZjRNX/+35B2V6WDdJjXTQRUTqNoZQMDqBqZd9OQKvIYRCsv968SbdbP Wj+EmeR/hY0swRQFxYkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshWb-0000000H67c-1sPW; Mon, 23 Sep 2024 11:46:41 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshVR-0000000H5vO-21gT; Mon, 23 Sep 2024 11:45:31 +0000 Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4XC1NV0ncDzySF5; Mon, 23 Sep 2024 19:43:54 +0800 (CST) Received: from kwepemh500013.china.huawei.com (unknown [7.202.181.146]) by mail.maildlp.com (Postfix) with ESMTPS id C4C421800A7; Mon, 23 Sep 2024 19:45:16 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemh500013.china.huawei.com (7.202.181.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 23 Sep 2024 19:45:16 +0800 From: Jinjie Ruan To: , , , , , , , CC: Subject: [PATCH] spi: rockchip: Fix excessive check for get_fifo_len() Date: Mon, 23 Sep 2024 19:55:16 +0800 Message-ID: <20240923115516.3563029-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemh500013.china.huawei.com (7.202.181.146) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_044530_388044_0A531AB2 X-CRM114-Status: UNSURE ( 8.19 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Since commit 13a96935e6f6 ("spi: rockchip: Support 64-location deep FIFOs"), get_fifo_len() return 64 or 32, never return 0, so remove the excessive check in rockchip_spi_probe(). Fixes: 13a96935e6f6 ("spi: rockchip: Support 64-location deep FIFOs") Signed-off-by: Jinjie Ruan --- drivers/spi/spi-rockchip.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 0bb33c43b1b4..680fe6ef6acc 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -819,11 +819,6 @@ static int rockchip_spi_probe(struct platform_device *pdev) } rs->fifo_len = get_fifo_len(rs); - if (!rs->fifo_len) { - dev_err(&pdev->dev, "Failed to get fifo length\n"); - ret = -EINVAL; - goto err_put_ctlr; - } pm_runtime_set_autosuspend_delay(&pdev->dev, ROCKCHIP_AUTOSUSPEND_TIMEOUT); pm_runtime_use_autosuspend(&pdev->dev);