From b4116938e13548f2b2c62c6ae6808c33b2130753 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Fri, 21 Nov 2008 20:40:09 -0200 Subject: [PATCH] --- yaml --- r: 122330 b: refs/heads/master c: f80b5e99c7dac5a9a0d72496cec5075a12cd1476 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/rfkill.h | 1 + trunk/net/rfkill/rfkill.c | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 53a346b33a65..6e9d882062cd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5925d976fbe99859d636e7075e5304625503c5fe +refs/heads/master: f80b5e99c7dac5a9a0d72496cec5075a12cd1476 diff --git a/trunk/include/linux/rfkill.h b/trunk/include/linux/rfkill.h index 4cd64b0d9825..f376a93927f7 100644 --- a/trunk/include/linux/rfkill.h +++ b/trunk/include/linux/rfkill.h @@ -108,6 +108,7 @@ struct rfkill { struct device dev; struct list_head node; + enum rfkill_state state_for_resume; }; #define to_rfkill(d) container_of(d, struct rfkill, dev) diff --git a/trunk/net/rfkill/rfkill.c b/trunk/net/rfkill/rfkill.c index ec26eae8004d..5ad411d3e8f8 100644 --- a/trunk/net/rfkill/rfkill.c +++ b/trunk/net/rfkill/rfkill.c @@ -565,10 +565,15 @@ static void rfkill_release(struct device *dev) #ifdef CONFIG_PM static int rfkill_suspend(struct device *dev, pm_message_t state) { + struct rfkill *rfkill = to_rfkill(dev); + /* mark class device as suspended */ if (dev->power.power_state.event != state.event) dev->power.power_state = state; + /* store state for the resume handler */ + rfkill->state_for_resume = rfkill->state; + return 0; } @@ -590,7 +595,7 @@ static int rfkill_resume(struct device *dev) rfkill_toggle_radio(rfkill, rfkill_epo_lock_active ? RFKILL_STATE_SOFT_BLOCKED : - rfkill->state, + rfkill->state_for_resume, 1); mutex_unlock(&rfkill->mutex);