Commit 908209c1 authored by Alan Jenkins's avatar Alan Jenkins Committed by John W. Linville

rfkill: don't impose global states on resume (just restore the previous states)

Once rfkill-input is disabled, the "global" states will only be used as
default initial states.

Since the states will always be the same after resume, we shouldn't
generate events on resume.
Signed-off-by: default avatarAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 869fb3a4
...@@ -212,7 +212,7 @@ void rfkill_destroy(struct rfkill *rfkill); ...@@ -212,7 +212,7 @@ void rfkill_destroy(struct rfkill *rfkill);
* *
* rfkill drivers that get events when the hard-blocked state changes * rfkill drivers that get events when the hard-blocked state changes
* use this function to notify the rfkill core (and through that also * use this function to notify the rfkill core (and through that also
* userspace) of the current state -- they should also use this after * userspace) of the current state. They should also use this after
* resume if the state could have changed. * resume if the state could have changed.
* *
* You need not (but may) call this function if poll_state is assigned. * You need not (but may) call this function if poll_state is assigned.
...@@ -234,8 +234,9 @@ bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); ...@@ -234,8 +234,9 @@ bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
* rfkill drivers that get events when the soft-blocked state changes * rfkill drivers that get events when the soft-blocked state changes
* (yes, some platforms directly act on input but allow changing again) * (yes, some platforms directly act on input but allow changing again)
* use this function to notify the rfkill core (and through that also * use this function to notify the rfkill core (and through that also
* userspace) of the current state -- they should also use this after * userspace) of the current state. It is not necessary to notify on
* resume if the state could have changed. * resume; since hibernation can always change the soft-blocked state,
* the rfkill core will unconditionally restore the previous state.
* *
* This function can be called in any context, even from within rfkill * This function can be called in any context, even from within rfkill
* callbacks. * callbacks.
......
...@@ -728,15 +728,11 @@ static int rfkill_resume(struct device *dev) ...@@ -728,15 +728,11 @@ static int rfkill_resume(struct device *dev)
struct rfkill *rfkill = to_rfkill(dev); struct rfkill *rfkill = to_rfkill(dev);
bool cur; bool cur;
mutex_lock(&rfkill_global_mutex); cur = !!(rfkill->state & RFKILL_BLOCK_SW);
cur = rfkill_global_states[rfkill->type].cur;
rfkill_set_block(rfkill, cur); rfkill_set_block(rfkill, cur);
mutex_unlock(&rfkill_global_mutex);
rfkill->suspended = false; rfkill->suspended = false;
schedule_work(&rfkill->uevent_work);
rfkill_resume_polling(rfkill); rfkill_resume_polling(rfkill);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment