asus-laptop: check WLED and BLED presence before adding rfkill
authorCorentin Chary <corentin.chary@gmail.com>
Thu, 15 Dec 2011 07:27:36 +0000 (08:27 +0100)
committerMatthew Garrett <mjg@redhat.com>
Tue, 20 Mar 2012 16:02:17 +0000 (12:02 -0400)
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/asus-laptop.c

index 547b9eba03ae12c43b357ad053ce0b256d005750..c1125b36d177e65b50502dd9f90e611bc9fa42c2 100644 (file)
@@ -1361,14 +1361,16 @@ static int asus_rfkill_init(struct asus_laptop *asus)
                goto exit;
 
 
-       if (asus->wled_type == TYPE_RFKILL)
+       if (!acpi_check_handle(asus->handle, METHOD_WLAN, NULL) &&
+           asus->wled_type == TYPE_RFKILL)
                result = asus_rfkill_setup(asus, &asus->wlan, "asus-wlan",
                                           WL_RSTS, RFKILL_TYPE_WLAN,
                                           &asus_rfkill_ops);
        if (result)
                goto exit;
 
-       if (asus->bled_type == TYPE_RFKILL)
+       if (!acpi_check_handle(asus->handle, METHOD_BLUETOOTH, NULL) &&
+           asus->bled_type == TYPE_RFKILL)
                result = asus_rfkill_setup(asus, &asus->bluetooth,
                                           "asus-bluetooth", BT_RSTS,
                                           RFKILL_TYPE_BLUETOOTH,