summaryrefslogtreecommitdiff
path: root/net/rfkill/input.c
diff options
context:
space:
mode:
authorGuobin Huang <huangguobin4@huawei.com>2021-04-06 15:11:56 +0300
committerJohannes Berg <johannes.berg@intel.com>2021-04-08 11:16:53 +0300
commited7247f30982bbc6f8bffd12a0c76398b90ec319 (patch)
treed0369a640f63aad8be943eb1fe59779dcfa65e40 /net/rfkill/input.c
parent3cd52c1e32fe7dfee09815ced702db9ee9f84ec9 (diff)
downloadlinux-ed7247f30982bbc6f8bffd12a0c76398b90ec319.tar.xz
rfkill: use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Guobin Huang <huangguobin4@huawei.com> Link: https://lore.kernel.org/r/1617711116-49370-1-git-send-email-huangguobin4@huawei.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/rfkill/input.c')
-rw-r--r--net/rfkill/input.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/rfkill/input.c b/net/rfkill/input.c
index 4b01baea1d4a..598d0a61bda7 100644
--- a/net/rfkill/input.c
+++ b/net/rfkill/input.c
@@ -36,7 +36,7 @@ module_param_named(master_switch_mode, rfkill_master_switch_mode, uint, 0);
MODULE_PARM_DESC(master_switch_mode,
"SW_RFKILL_ALL ON should: 0=do nothing (only unlock); 1=restore; 2=unblock all");
-static spinlock_t rfkill_op_lock;
+static DEFINE_SPINLOCK(rfkill_op_lock);
static bool rfkill_op_pending;
static unsigned long rfkill_sw_pending[BITS_TO_LONGS(NUM_RFKILL_TYPES)];
static unsigned long rfkill_sw_state[BITS_TO_LONGS(NUM_RFKILL_TYPES)];
@@ -330,8 +330,6 @@ int __init rfkill_handler_init(void)
return -EINVAL;
}
- spin_lock_init(&rfkill_op_lock);
-
/* Avoid delay at first schedule */
rfkill_last_scheduled =
jiffies - msecs_to_jiffies(RFKILL_OPS_DELAY) - 1;