Skip to content

Commit

Permalink
rfkill: print events when input handler is disabled/enabled
Browse files Browse the repository at this point in the history
It is useful for debugging when we know if something disabled
the in-kernel rfkill input handler.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 10, 2009
1 parent 9b9c5aa commit 207ee16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 207ee16

Please sign in to comment.