From patchwork Mon Jun 24 02:31:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youwan Wang X-Patchwork-Id: 13708859 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 2A296C2BBCA for ; Mon, 24 Jun 2024 02:32:06 +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-Transfer-Encoding: MIME-Version:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=xu70CJTlQvMNfMoS8swpl713+EXVzyXQcX1gzZtAKwQ=; b=C2BznD8rVZDQnFRglxerJ8ZuUJ UZT97Eq/mo+wq18ev/ACxRslEaTeVnTdKOR2x9rRKAiQgEN9Al4SiTOHuRSV95oHqOknHRwylMV7g MZFMOPCsznSyZAjMk/Z2gaQFnfQW6v7Kx626SE00S2EyYtOC06IkhX3XfsEaOLHZX9OvkcZvgc141 D+4RVrL5UYJT2Nz7L7kMn9AowS6yFsaGraoiBQTlWQeq+UG1aHvDfbvV0KWJyTN6K3C9RTdVJmKWY sBzcpoasdD5PlsLbnAgjqNJ9Clg3UoHYdO+rY6YGLvRyo/gETvV9BPHnrLk+V4slg/qXA6cAjrl8r QrX//LpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLZUn-0000000FIbX-3Q9z; Mon, 24 Jun 2024 02:31:53 +0000 Received: from [42.101.60.195] (helo=mail.nfschina.com) by bombadil.infradead.org with smtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLZUi-0000000FIaZ-295x for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 02:31:50 +0000 Received: from localhost.localdomain (unknown [103.163.180.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 31FD46019EDA9; Mon, 24 Jun 2024 10:31:12 +0800 (CST) X-MD-Sfrom: youwan@nfschina.com X-MD-SrcIP: 103.163.180.2 From: Youwan Wang To: youwan@nfschina.com Cc: guohanjun@huawei.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lpieralisi@kernel.org, rafael@kernel.org, sudeep.holla@arm.com, catalin.marinas@arm.com, will@kernel.org Subject: [PATCH v4] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Date: Mon, 24 Jun 2024 10:31:01 +0800 Message-Id: <20240624023101.369633-1-youwan@nfschina.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240620133758.319392-1-youwan@nfschina.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240623_193148_756865_9555A72A X-CRM114-Status: GOOD ( 11.65 ) 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 amba_register_dummy_clk() is called only once from acpi_amba_init() and acpi_amba_init() itself is called once during the initialisation. amba_dummy_clk can't be initialised before this in any other code path and hence the check for already registered amba_dummy_clk is not necessary. Drop the same. Signed-off-by: Youwan Wang Acked-by: Sudeep Holla Acked-by: Hanjun Guo --- v1->v2->v3: Modify the commit log description v3->v4: Update the commit message suggested by Sudeep; Add Acked-by from Sudeep; +Cc ARM64 maintainers Catalin and Will. --- drivers/acpi/arm64/amba.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/acpi/arm64/amba.c b/drivers/acpi/arm64/amba.c index 60be8ee1dbdc..ef438417cc80 100644 --- a/drivers/acpi/arm64/amba.c +++ b/drivers/acpi/arm64/amba.c @@ -35,11 +35,7 @@ static const struct acpi_device_id amba_id_list[] = { static void amba_register_dummy_clk(void) { - static struct clk *amba_dummy_clk; - - /* If clock already registered */ - if (amba_dummy_clk) - return; + struct clk *amba_dummy_clk; amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, 0, 0); clk_register_clkdev(amba_dummy_clk, "apb_pclk", NULL);