提交 207ee162 编写于 作者: J Johannes Berg 提交者: John W. Linville

rfkill: print events when input handler is disabled/enabled

It is useful for debugging when we know if something disabled
the in-kernel rfkill input handler.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 9b9c5aae
......@@ -1134,7 +1134,8 @@ static int rfkill_fop_release(struct inode *inode, struct file *file)
#ifdef CONFIG_RFKILL_INPUT
if (data->input_handler)
atomic_dec(&rfkill_input_disabled);
if (atomic_dec_return(&rfkill_input_disabled) == 0)
printk(KERN_DEBUG "rfkill: input handler enabled\n");
#endif
kfree(data);
......@@ -1157,7 +1158,8 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd,
mutex_lock(&data->mtx);
if (!data->input_handler) {
atomic_inc(&rfkill_input_disabled);
if (atomic_inc_return(&rfkill_input_disabled) == 1)
printk(KERN_DEBUG "rfkill: input handler disabled\n");
data->input_handler = true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册