From: Johannes Berg Date: Sun, 7 Jun 2009 10:26:52 +0000 (+0200) Subject: rfkill: print events when input handler is disabled/enabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=207ee1621722876bb79828689582bf77fd1be200;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: Marcel Holtmann Signed-off-by: John W. Linville --- diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 11b7314723df..e161ebc40a35 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) #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; }