diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-09-25 15:54:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-25 15:54:32 -0400 |
commit | 5419575e838cd2cd11a1b30449eb58decdf51f9f (patch) | |
tree | 36b20c033f58751fe11b71938738ad2cb39b20d0 /net/rfkill/core.c | |
parent | 0c49b69931a0001912bb4e48c415d33031ddb217 (diff) | |
parent | 64629b9d412544b0ed744405944fd6edf79d7e0d (diff) | |
download | linux-5419575e838cd2cd11a1b30449eb58decdf51f9f.tar.bz2 |
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'net/rfkill/core.c')
-rw-r--r-- | net/rfkill/core.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index c275bad12068..a5c952741279 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -270,6 +270,7 @@ static bool __rfkill_set_hw_state(struct rfkill *rfkill, static void rfkill_set_block(struct rfkill *rfkill, bool blocked) { unsigned long flags; + bool prev, curr; int err; if (unlikely(rfkill->dev.power.power_state.event & PM_EVENT_SLEEP)) @@ -284,6 +285,8 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked) rfkill->ops->query(rfkill, rfkill->data); spin_lock_irqsave(&rfkill->lock, flags); + prev = rfkill->state & RFKILL_BLOCK_SW; + if (rfkill->state & RFKILL_BLOCK_SW) rfkill->state |= RFKILL_BLOCK_SW_PREV; else @@ -313,10 +316,13 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked) } rfkill->state &= ~RFKILL_BLOCK_SW_SETCALL; rfkill->state &= ~RFKILL_BLOCK_SW_PREV; + curr = rfkill->state & RFKILL_BLOCK_SW; spin_unlock_irqrestore(&rfkill->lock, flags); rfkill_led_trigger_event(rfkill); - rfkill_event(rfkill); + + if (prev != curr) + rfkill_event(rfkill); } #ifdef CONFIG_RFKILL_INPUT |