From: Hans de Goede Date: Sun, 17 Nov 2013 13:00:18 +0000 (+0100) Subject: dell-laptop: If there is no hwswitch, then clear all hw-controlled bits X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ddde708217af6d5fe43c0086247c05ed317076b4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dell-laptop: If there is no hwswitch, then clear all hw-controlled bits To ensure we don't enter any hw-switch related code paths on machines without a hw-switch. Signed-off-by: Hans de Goede Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index bae932b60bab..48fabf6b6ecb 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -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)) {