]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: renesas: cpg-lib: Use DEFINE_SPINLOCK() for global spinlock
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 29 May 2024 09:35:09 +0000 (11:35 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 7 Jun 2024 12:09:59 +0000 (14:09 +0200)
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
drivers/clk/renesas/rcar-cpg-lib.c
drivers/clk/renesas/rcar-gen3-cpg.c
drivers/clk/renesas/rcar-gen4-cpg.c

index 5a15f8788b9227d90a6a1020a555fa09b1951beb..42b126ea3e1337c1a996770e3f46bdaae7a6fa59 100644 (file)
@@ -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)
 {
index d0129a6509411662e04bdeb6bc3cfbcaee269885..20b89eb6c35c1f0717104e53f63598b4c8db2087 100644 (file)
@@ -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;
 }
index a2bbdad021ed8e952e69d1dfc2573bae6d25d098..77a4bb3e17f34848b4fa932903954e73a4eeb80b 100644 (file)
@@ -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;
 }