diff options
Diffstat (limited to 'net/rfkill/core.c')
-rw-r--r-- | net/rfkill/core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index a88743bc0032..d2438f940a25 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -121,7 +121,6 @@ static struct { static bool rfkill_epo_lock_active; -static unsigned long rfkill_no; #ifdef CONFIG_RFKILL_LEDS static void rfkill_led_trigger_event(struct rfkill *rfkill) @@ -694,7 +693,7 @@ static struct device_attribute rfkill_dev_attrs[] = { __ATTR(type, S_IRUGO, rfkill_type_show, NULL), __ATTR(index, S_IRUGO, rfkill_idx_show, NULL), __ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL), - __ATTR(state, S_IRUGO|S_IWUGO, rfkill_state_show, rfkill_state_store), + __ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store), __ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store), __ATTR_NULL }; @@ -881,6 +880,7 @@ static void rfkill_sync_work(struct work_struct *work) int __must_check rfkill_register(struct rfkill *rfkill) { + static unsigned long rfkill_no; struct device *dev = &rfkill->dev; int error; @@ -960,8 +960,8 @@ void rfkill_unregister(struct rfkill *rfkill) mutex_lock(&rfkill_global_mutex); rfkill_send_events(rfkill, RFKILL_OP_DEL); list_del_init(&rfkill->node); - rfkill_no--; mutex_unlock(&rfkill_global_mutex); + rfkill_led_trigger_unregister(rfkill); } EXPORT_SYMBOL(rfkill_unregister); @@ -1180,6 +1180,7 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd, #endif static const struct file_operations rfkill_fops = { + .owner = THIS_MODULE, .open = rfkill_fop_open, .read = rfkill_fop_read, .write = rfkill_fop_write, |