rfkill: preserve state across suspend
commit55c2192b3dee885bdf5ecc39405cce1f6cdd742a
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 24 Mar 2009 06:53:16 +0000 (24 03:53 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 24 Mar 2009 06:53:16 +0000 (24 03:53 -0300)
treebc938f08195a8d63f8c9e2d3ebb0fdf1ce5de0d1
parent72ee2b9935e06fa562334ddbc43ce236a1f724ea
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