diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2024-05-29 11:35:09 +0200 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2024-06-07 14:09:59 +0200 |
commit | 3b2f834dd3f952a0c69c0dacef68172742acacbc (patch) | |
tree | 6a2da58a285f0b386f520066160e5b6239dc1cdd | |
parent | clk: renesas: r8a77970: Use common cpg_lock (diff) | |
download | linux-3b2f834dd3f952a0c69c0dacef68172742acacbc.tar.xz linux-3b2f834dd3f952a0c69c0dacef68172742acacbc.zip |
clk: renesas: cpg-lib: Use DEFINE_SPINLOCK() for global spinlock
A global spinlock can be initialized automatically with
DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().
Suggested-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/9073a6bfb7791e492156331fa8a0ea87a7c7cef6.1716975021.git.geert+renesas@glider.be
-rw-r--r-- | drivers/clk/renesas/rcar-cpg-lib.c | 2 | ||||
-rw-r--r-- | drivers/clk/renesas/rcar-gen3-cpg.c | 2 | ||||
-rw-r--r-- | drivers/clk/renesas/rcar-gen4-cpg.c | 2 |
3 files changed, 1 insertions, 5 deletions
diff --git a/drivers/clk/renesas/rcar-cpg-lib.c b/drivers/clk/renesas/rcar-cpg-lib.c index 5a15f8788b92..42b126ea3e13 100644 --- a/drivers/clk/renesas/rcar-cpg-lib.c +++ b/drivers/clk/renesas/rcar-cpg-lib.c @@ -22,7 +22,7 @@ #include "rcar-cpg-lib.h" -spinlock_t cpg_lock; +DEFINE_SPINLOCK(cpg_lock); void cpg_reg_modify(void __iomem *reg, u32 clear, u32 set) { diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c index d0129a650941..20b89eb6c35c 100644 --- a/drivers/clk/renesas/rcar-gen3-cpg.c +++ b/drivers/clk/renesas/rcar-gen3-cpg.c @@ -551,7 +551,5 @@ int __init rcar_gen3_cpg_init(const struct rcar_gen3_cpg_pll_config *config, cpg_quirks = (uintptr_t)attr->data; pr_debug("%s: mode = 0x%x quirks = 0x%x\n", __func__, mode, cpg_quirks); - spin_lock_init(&cpg_lock); - return 0; } diff --git a/drivers/clk/renesas/rcar-gen4-cpg.c b/drivers/clk/renesas/rcar-gen4-cpg.c index a2bbdad021ed..77a4bb3e17f3 100644 --- a/drivers/clk/renesas/rcar-gen4-cpg.c +++ b/drivers/clk/renesas/rcar-gen4-cpg.c @@ -466,7 +466,5 @@ int __init rcar_gen4_cpg_init(const struct rcar_gen4_cpg_pll_config *config, cpg_clk_extalr = clk_extalr; cpg_mode = mode; - spin_lock_init(&cpg_lock); - return 0; } |