aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/rfkill.h1
-rw-r--r--net/rfkill/rfkill.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 4cd64b0d9825..f376a93927f7 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -108,6 +108,7 @@ struct rfkill {
108 108
109 struct device dev; 109 struct device dev;
110 struct list_head node; 110 struct list_head node;
111 enum rfkill_state state_for_resume;
111}; 112};
112#define to_rfkill(d) container_of(d, struct rfkill, dev) 113#define to_rfkill(d) container_of(d, struct rfkill, dev)
113 114
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index ec26eae8004d..5ad411d3e8f8 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -565,10 +565,15 @@ static void rfkill_release(struct device *dev)
565#ifdef CONFIG_PM 565#ifdef CONFIG_PM
566static int rfkill_suspend(struct device *dev, pm_message_t state) 566static int rfkill_suspend(struct device *dev, pm_message_t state)
567{ 567{
568 struct rfkill *rfkill = to_rfkill(dev);
569
568 /* mark class device as suspended */ 570 /* mark class device as suspended */
569 if (dev->power.power_state.event != state.event) 571 if (dev->power.power_state.event != state.event)
570 dev->power.power_state = state; 572 dev->power.power_state = state;
571 573
574 /* store state for the resume handler */
575 rfkill->state_for_resume = rfkill->state;
576
572 return 0; 577 return 0;
573} 578}
574 579
@@ -590,7 +595,7 @@ static int rfkill_resume(struct device *dev)
590 rfkill_toggle_radio(rfkill, 595 rfkill_toggle_radio(rfkill,
591 rfkill_epo_lock_active ? 596 rfkill_epo_lock_active ?
592 RFKILL_STATE_SOFT_BLOCKED : 597 RFKILL_STATE_SOFT_BLOCKED :
593 rfkill->state, 598 rfkill->state_for_resume,
594 1); 599 1);
595 600
596 mutex_unlock(&rfkill->mutex); 601 mutex_unlock(&rfkill->mutex);