Commit c3a90058 authored by Lukas Wunner's avatar Lukas Wunner Committed by Takashi Iwai

ALSA: hda - Use acpi_dev_present()

Use shiny new acpi_dev_present() and remove all the boilerplate
to search for a particular ACPI device. No functional change.
Cf. 2d12b6b3 ("ACPI / utils: Add acpi_dev_present()").
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Acked-by: default avatarHui Wang <hui.wang@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 99d73559
...@@ -10,23 +10,10 @@ ...@@ -10,23 +10,10 @@
static int (*led_set_func)(int, bool); static int (*led_set_func)(int, bool);
static void (*old_vmaster_hook)(void *, int); static void (*old_vmaster_hook)(void *, int);
static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context,
void **rv)
{
bool *found = context;
*found = true;
return AE_OK;
}
static bool is_thinkpad(struct hda_codec *codec) static bool is_thinkpad(struct hda_codec *codec)
{ {
bool found = false; return (codec->core.subsystem_id >> 16 == 0x17aa) &&
if (codec->core.subsystem_id >> 16 != 0x17aa) (acpi_dev_present("LEN0068") || acpi_dev_present("IBM0068"));
return false;
if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found)
return true;
found = false;
return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found;
} }
static void update_tpacpi_mute_led(void *private_data, int enabled) static void update_tpacpi_mute_led(void *private_data, int enabled)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment