From patchwork Thu Jun 20 13:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youwan Wang X-Patchwork-Id: 13705535 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 733ADC27C79 for ; Thu, 20 Jun 2024 13:38:35 +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=vjlmLdLWPpShIBImq4P/s/o4OHjzb4qfPLZotNVQCgs=; b=Qq41q1o7lYchZZ++Z42hNJz7rq 4o5Su883zwWK+60uF0+g+RTBZY3+RKnUWA2OKW7kkvNkRI7yDvM1NBuZY1imfbHzzlofELxVCIrxa 1gome1mKMfAtmNbXjqqcoR1F5YuV1oiXmv2eMzSf9qvM/mpLJKO8zn8VmS4YHLIEqMOusasuA6G/F CGgcpZymgQCjgSDDe6F9mvyMF4h2wiEYfX0p7+Y0v+UxlD0zhrw8LwngfXfdcR+9pgmhCN3NHt999 i8ny7a0uS09H7XkQYMLtPIkD9x/Bm0RHHxZfghbGUbPf3UFZ6L0wXQNVMQ7UgmKoTZLuDTgp34+3Q z6obV34g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKHza-00000005EvY-02mh; Thu, 20 Jun 2024 13:38:22 +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 1sKHzW-00000005EuS-0xrF for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2024 13:38:20 +0000 Received: from localhost.localdomain (unknown [103.163.180.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 28B9F6047F7D1; Thu, 20 Jun 2024 21:38:10 +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] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Date: Thu, 20 Jun 2024 21:37:58 +0800 Message-Id: <20240620133758.319392-1-youwan@nfschina.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240618115845.261297-1-youwan@nfschina.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_063818_476248_3EAA4D8B X-CRM114-Status: GOOD ( 10.93 ) 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 --- 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);