[PATCH v1] ACPI /amba: Fix meaningless code for amba_register_dummy_clk()
Youwan Wang
youwan at nfschina.com
Sun Jun 16 03:00:54 PDT 2024
Defining `amba_dummy_clk` as static is meaningless.
The conditional check `if (amba_dummy_clk)` is intended to
determine whether the clock has already been registered.
However,in this function, the variable `amba_dummy_clk`
will always be NULL.
Signed-off-by: Youwan Wang <youwan at nfschina.com>
---
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);
--
2.25.1
More information about the linux-arm-kernel
mailing list