dell-laptop: If there is no hwswitch, then clear all hw-controlled bits
authorHans de Goede <hdegoede@redhat.com>
Sun, 17 Nov 2013 13:00:18 +0000 (14:00 +0100)
committerMatthew Garrett <matthew.garrett@nebula.com>
Wed, 20 Nov 2013 23:50:48 +0000 (18:50 -0500)
To ensure we don't enter any hw-switch related code paths on machines without
a hw-switch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/dell-laptop.c

index bae932b60babd1b4d84b722addd9d6c01e6e6c87..48fabf6b6ecb6a8a94986a44adfdab32ed188f5b 100644 (file)
@@ -548,6 +548,9 @@ static int __init dell_setup_rfkill(void)
        buffer->input[0] = 0x2;
        dell_send_request(buffer, 17, 11);
        hwswitch_state = buffer->output[1];
+       /* If there is no hwswitch, then clear all hw-controlled bits */
+       if (!(status & BIT(0)))
+               hwswitch_state &= ~7;
        release_buffer();
 
        if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {