From d26169017100217d00fab6fc182f0c260a40d766 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 11 Nov 2008 20:26:57 -0200 Subject: [PATCH] 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 Cc: Ivo van Doorn Cc: Matthew Garrett Cc: Alan Jenkins --- net/rfkill/rfkill.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 4113454a5ad..c56b5c05f2b 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) static int rfkill_resume(struct device *dev) { struct rfkill *rfkill = to_rfkill(dev); + enum rfkill_state newstate; if (dev->power.power_state.event != PM_EVENT_ON) { mutex_lock(&rfkill->mutex); @@ -592,6 +593,9 @@ static int rfkill_resume(struct device *dev) * * Issue a notification in any case */ + if (rfkill->get_state && + !rfkill->get_state(rfkill->data, &newstate)) + rfkill->state = newstate; rfkill_toggle_radio(rfkill, rfkill_epo_lock_active ? RFKILL_STATE_SOFT_BLOCKED : -- 2.11.4.GIT