public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Youwan Wang <youwan@nfschina.com>
To: lpieralisi@kernel.org
Cc: guohanjun@huawei.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, lenb@kernel.org,
	rafael@kernel.org, sudeep.holla@arm.com,
	linux-acpi@vger.kernel.org, Youwan Wang <youwan@nfschina.com>
Subject: [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
Date: Thu, 20 Jun 2024 08:59:30 +0800	[thread overview]
Message-ID: <20240620005930.295880-1-youwan@nfschina.com> (raw)

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>
---
 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


             reply	other threads:[~2024-06-20  1:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20  0:59 Youwan Wang [this message]
2024-06-20  8:38 ` [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Sudeep Holla
  -- strict thread matches above, loose matches on Subject: below --
2024-06-18 11:58 [PATCH v3] ACPI /amba: Fix meaningless code for amba_register_dummy_clk() Youwan Wang
2024-06-20 13:37 ` [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Youwan Wang
2024-06-24  2:09   ` Hanjun Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240620005930.295880-1-youwan@nfschina.com \
    --to=youwan@nfschina.com \
    --cc=guohanjun@huawei.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox