aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/rfkill.h7
-rw-r--r--net/rfkill/core.c6
2 files changed, 5 insertions, 8 deletions
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index c1dca0b8138b..16e39c7a67fc 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -212,7 +212,7 @@ void rfkill_destroy(struct rfkill *rfkill);
212 * 212 *
213 * rfkill drivers that get events when the hard-blocked state changes 213 * rfkill drivers that get events when the hard-blocked state changes
214 * use this function to notify the rfkill core (and through that also 214 * use this function to notify the rfkill core (and through that also
215 * userspace) of the current state -- they should also use this after 215 * userspace) of the current state. They should also use this after
216 * resume if the state could have changed. 216 * resume if the state could have changed.
217 * 217 *
218 * You need not (but may) call this function if poll_state is assigned. 218 * 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 * rfkill drivers that get events when the soft-blocked state changes 234 * rfkill drivers that get events when the soft-blocked state changes
235 * (yes, some platforms directly act on input but allow changing again) 235 * (yes, some platforms directly act on input but allow changing again)
236 * use this function to notify the rfkill core (and through that also 236 * use this function to notify the rfkill core (and through that also
237 * userspace) of the current state -- they should also use this after 237 * userspace) of the current state. It is not necessary to notify on
238 * resume if the state could have changed. 238 * resume; since hibernation can always change the soft-blocked state,
239 * the rfkill core will unconditionally restore the previous state.
239 * 240 *
240 * This function can be called in any context, even from within rfkill 241 * This function can be called in any context, even from within rfkill
241 * callbacks. 242 * callbacks.
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index fa430bd03f14..4e68ab439d5d 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -728,15 +728,11 @@ static int rfkill_resume(struct device *dev)
728 struct rfkill *rfkill = to_rfkill(dev); 728 struct rfkill *rfkill = to_rfkill(dev);
729 bool cur; 729 bool cur;
730 730
731 mutex_lock(&rfkill_global_mutex); 731 cur = !!(rfkill->state & RFKILL_BLOCK_SW);
732 cur = rfkill_global_states[rfkill->type].cur;
733 rfkill_set_block(rfkill, cur); 732 rfkill_set_block(rfkill, cur);
734 mutex_unlock(&rfkill_global_mutex);
735 733
736 rfkill->suspended = false; 734 rfkill->suspended = false;
737 735
738 schedule_work(&rfkill->uevent_work);
739
740 rfkill_resume_polling(rfkill); 736 rfkill_resume_polling(rfkill);
741 737
742 return 0; 738 return 0;