diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-07 06:26:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-10 13:27:54 -0400 |
commit | 207ee1621722876bb79828689582bf77fd1be200 (patch) | |
tree | 93ea2cf095ef571dd89c2510e5b7f4e5e85e64ae /net/rfkill | |
parent | 9b9c5aaeedfda256ed77094303e2a7242c3290da (diff) |
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: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/rfkill')
-rw-r--r-- | net/rfkill/core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 11b7314723d..e161ebc40a3 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -1134,7 +1134,8 @@ static int rfkill_fop_release(struct inode *inode, struct file *file) | |||
1134 | 1134 | ||
1135 | #ifdef CONFIG_RFKILL_INPUT | 1135 | #ifdef CONFIG_RFKILL_INPUT |
1136 | if (data->input_handler) | 1136 | if (data->input_handler) |
1137 | atomic_dec(&rfkill_input_disabled); | 1137 | if (atomic_dec_return(&rfkill_input_disabled) == 0) |
1138 | printk(KERN_DEBUG "rfkill: input handler enabled\n"); | ||
1138 | #endif | 1139 | #endif |
1139 | 1140 | ||
1140 | kfree(data); | 1141 | kfree(data); |
@@ -1157,7 +1158,8 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd, | |||
1157 | mutex_lock(&data->mtx); | 1158 | mutex_lock(&data->mtx); |
1158 | 1159 | ||
1159 | if (!data->input_handler) { | 1160 | if (!data->input_handler) { |
1160 | atomic_inc(&rfkill_input_disabled); | 1161 | if (atomic_inc_return(&rfkill_input_disabled) == 1) |
1162 | printk(KERN_DEBUG "rfkill: input handler disabled\n"); | ||
1161 | data->input_handler = true; | 1163 | data->input_handler = true; |
1162 | } | 1164 | } |
1163 | 1165 | ||