Skip to contentSkip to conversation

MIPS: Alchemy: Use DEFINE_SPINLOCK() for spinlock

PATCH Applied Chen Lifu 2 participants 2 messages Mar 27, 2021 – Apr 12, 2021

Subsystems (2)
lore
Share & tools
lore

Chen Lifu

author
#0 lore raw

PATCH 1/1 MIPS: Alchemy: Use DEFINE_SPINLOCK() for spinlock

From: Lifu Chen <[email protected]>

spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().

---
 arch/mips/alchemy/common/clock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/mips/alchemy/common/clock.c +1 -2
index f0c830337104..c01be8c45271 100644
@@ -111,7 +111,7 @@ static struct clk_aliastable {
 /* access locks to SYS_FREQCTRL0/1 and SYS_CLKSRC registers */
 static spinlock_t alchemy_clk_fg0_lock;
 static spinlock_t alchemy_clk_fg1_lock;
-static spinlock_t alchemy_clk_csrc_lock;
+static DEFINE_SPINLOCK(alchemy_clk_csrc_lock);
 
 /* CPU Core clock *****************************************************/
 
@@ -996,7 +996,6 @@ static int __init alchemy_clk_setup_imux(int ctype)
 	if (!a)
 		return -ENOMEM;
 
-	spin_lock_init(&alchemy_clk_csrc_lock);
 	ret = 0;
 
 	for (i = 0; i < 6; i++) {
maintainer Applied
#1 lore raw
Quoted 10 lines · Chen Lifu

From: Lifu Chen <[email protected]>

spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().

---
 arch/mips/alchemy/common/clock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]