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: 13809534 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 78A8ACF9C6E for ; Mon, 23 Sep 2024 11:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=zQdyTykoYDIGPVCX4KX3LgQvlccNKaROMG2WF8Od0bw=; b=beIf2KjJSMTCLaLBTZjAIR54Hp uH1i15axAYv6VgegsSHXMrtrsKi7/8i7tANZFtGd5c1C2LI/XmSs4FHWlxKgH5iGIH3TtTw88Jeat TsskBDukihfSt9wzH3BNaIfuzu04klnvFML0wASrfH/S1JdHYY8TGh8EWfT14Aj7RebWaxr3pxSvV 48tE0Fe0rDLaBcH3v7COBUJrkkh847LSkYykWtB1/jLE/GpoZtxmovuVk6Bz+Rs3vnoiIe2KHgg15 Mm/8zNprnNsBPoIHi9SRadLNsYHGHYqW3FU1/cp4WVHeYbEpbJSPgFVROtcWckCDmAcN28laoslOS 4SQ5kWTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshWa-0000000H67Y-3l1N; Mon, 23 Sep 2024 11:46:40 +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-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 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);