rfkill: preserve state across suspend
commit47e1aa01b4d0c83d397f24c08bce5460360d7276
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 3 May 2009 01:21:06 +0000 (2 22:21 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 3 May 2009 01:21:06 +0000 (2 22:21 -0300)
tree10d468031c8d1962918f4933df2597f6123c8dd6
parent669882388f320d92169ed8a58780ab67000ec1ac
rfkill: preserve state across suspend

The rfkill class API requires that the driver connected to a class
call rfkill_force_state() on resume to update the real state of the
rfkill controller, OR that it provides a get_state() hook.

This means there is potentially a hidden call in the resume code flow
that changes rfkill->state (i.e. rfkill_force_state()), so the
previous state of the transmitter was being lost.

The simplest and most future-proof way to fix this is to explicitly
store the pre-sleep state on the rfkill structure, and restore from
that on resume.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
include/linux/rfkill.h
net/rfkill/rfkill.c