• Henrique de Moraes Holschuh's avatar
    rfkill: preserve state across suspend · f80b5e99
    Henrique de Moraes Holschuh authored
    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: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
    Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
    Cc: Matthew Garrett <mjg59@srcf.ucam.org>
    Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    f80b5e99
rfkill.c 24.9 KB