rfkill: preserve state across suspend
commitae443ee7a6f995b0f1c2ac5c08e0fa5c242177e1
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 11 Nov 2008 22:07:10 +0000 (11 20:07 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sat, 22 Nov 2008 21:22:23 +0000 (22 19:22 -0200)
treefcf5e7bd0343a1e53b0299377aebf540a8f29b41
parent49175bf6f6f5945262a6222ec4acb8ab20d9457e
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