]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
authorYouwan Wang <youwan@nfschina.com>
Mon, 24 Jun 2024 02:31:01 +0000 (10:31 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 24 Jun 2024 17:36:07 +0000 (18:36 +0100)
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 <youwan@nfschina.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://lore.kernel.org/r/20240624023101.369633-1-youwan@nfschina.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/acpi/arm64/amba.c

index e1f0bbb8f3938877540da84f7c07f4119873759d..1350083bce5f1fe0569f44ce9bd4efab8d7ed4e4 100644 (file)
@@ -27,11 +27,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);