aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2008-11-21 17:40:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-26 09:47:44 -0500
commit24689c8590be6bc0486af665c5ceda6aeff4d53a (patch)
treeb8e2fe4f8f243941ced77f274a3b30cb99786e84 /net
parentf80b5e99c7dac5a9a0d72496cec5075a12cd1476 (diff)
rfkill: always call get_state() hook on resume
We "optimize" away the get_state() hook call on rfkill_toggle_radio when doing a forced state change. This means the resume path is not calling get_state() as it should. Call it manually on the resume handler, as we don't want to mess with the EPO path by removing the optimization. This has the added benefit of making it explicit that rfkill->state could have been modified before we hit the rfkill_toggle_radio() call in the class resume handler. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/rfkill/rfkill.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 5ad411d3e8f8..051d2c9ea66b 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -580,6 +580,7 @@ static int rfkill_suspend(struct device *dev, pm_message_t state)
580static int rfkill_resume(struct device *dev) 580static int rfkill_resume(struct device *dev)
581{ 581{
582 struct rfkill *rfkill = to_rfkill(dev); 582 struct rfkill *rfkill = to_rfkill(dev);
583 enum rfkill_state newstate;
583 584
584 if (dev->power.power_state.event != PM_EVENT_ON) { 585 if (dev->power.power_state.event != PM_EVENT_ON) {
585 mutex_lock(&rfkill->mutex); 586 mutex_lock(&rfkill->mutex);
@@ -587,6 +588,15 @@ static int rfkill_resume(struct device *dev)
587 dev->power.power_state.event = PM_EVENT_ON; 588 dev->power.power_state.event = PM_EVENT_ON;
588 589
589 /* 590 /*
591 * rfkill->state could have been modified before we got
592 * called, and won't be updated by rfkill_toggle_radio()
593 * in force mode. Sync it FIRST.
594 */
595 if (rfkill->get_state &&
596 !rfkill->get_state(rfkill->data, &newstate))
597 rfkill->state = newstate;
598
599 /*
590 * If we are under EPO, kick transmitter offline, 600 * If we are under EPO, kick transmitter offline,
591 * otherwise restore to pre-suspend state. 601 * otherwise restore to pre-suspend state.
592 * 602 *