Skip to contentSkip to conversation

Rename get_property to of_get_property: use DEFINE_SPINLOCK() for spinlock

PATCH In review Ye Bin 2 participants 3 messages Apr 9, 2021

Subsystems (2)
lore
Share & tools
lore

Ye Bin

author
#0 lore raw

PATCH 1/1 Rename get_property to of_get_property: use DEFINE_SPINLOCK() for spinlock

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

---
 drivers/macintosh/via-pmu-led.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/macintosh/via-pmu-led.c +1 -3
index ae067ab2373d..2502119cff42 100644
@@ -27,7 +27,7 @@
 #include <linux/pmu.h>
 #include <asm/prom.h>
 
-static spinlock_t pmu_blink_lock;
+static DEFINE_SPINLOCK(pmu_blink_lock);
 static struct adb_request pmu_blink_req;
 /* -1: no change, 0: request off, 1: request on */
 static int requested_change;
@@ -105,8 +105,6 @@ static int __init via_pmu_led_init(void)
 		return -ENODEV;
 	}
 	of_node_put(dt);
-
-	spin_lock_init(&pmu_blink_lock);
 	/* no outstanding req */
 	pmu_blink_req.complete = 1;
 	pmu_blink_req.done = pmu_req_done;
#1 lore raw

Rename get_property to of_get_property: use DEFINE_SPINLOCK() for spinlock

~~~~~~~~~~~~~

这是啥模块名?

Quoted 32 lines · Ye Bin

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

---
  drivers/macintosh/via-pmu-led.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/macintosh/via-pmu-led.c +1 -3
index ae067ab2373d..2502119cff42 100644
@@ -27,7 +27,7 @@
  #include <linux/pmu.h>
  #include <asm/prom.h>
 
-static spinlock_t pmu_blink_lock;
+static DEFINE_SPINLOCK(pmu_blink_lock);
  static struct adb_request pmu_blink_req;
  /* -1: no change, 0: request off, 1: request on */
  static int requested_change;
@@ -105,8 +105,6 @@ static int __init via_pmu_led_init(void)
  		return -ENODEV;
  	}
  	of_node_put(dt);
-
-	spin_lock_init(&pmu_blink_lock);
  	/* no outstanding req */
  	pmu_blink_req.complete = 1;
  	pmu_blink_req.done = pmu_req_done;
#2 lore raw

Rename get_property to of_get_property: use DEFINE_SPINLOCK() for spinlock

^^^^^^^^^

Please fix the module name in the patch subject.

Quoted 32 lines

spinlock can be initialized automatically with DEFINE_SPINLOCK()

Quoted 30 lines

rather than explicitly calling spin_lock_init().

---
  drivers/macintosh/via-pmu-led.c | 4 +---

  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/macintosh/via-pmu-led.c +1 -2
index ae067ab2373d..2502119cff42 100644
@@ -27,7 +27,7 @@
   #include <linux/pmu.h>
   #include <asm/prom.h>
   -static spinlock_t pmu_blink_lock;
+static DEFINE_SPINLOCK(pmu_blink_lock);
   static struct adb_request pmu_blink_req;
   /* -1: no change, 0: request off, 1: request on */
   static int requested_change;
@@ -105,8 +105,6 @@ static int __init via_pmu_led_init(void)
           return -ENODEV;
       }
       of_node_put(dt);
-
-    spin_lock_init(&pmu_blink_lock);
       /* no outstanding req */
       pmu_blink_req.complete = 1;
       pmu_blink_req.done = pmu_req_done;