Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()").

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Lukas Wunner and committed by
Takashi Iwai
c3a90058 99d73559

+2 -15
+2 -15
sound/pci/hda/thinkpad_helper.c
··· 10 10 static int (*led_set_func)(int, bool); 11 11 static void (*old_vmaster_hook)(void *, int); 12 12 13 - static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context, 14 - void **rv) 15 - { 16 - bool *found = context; 17 - *found = true; 18 - return AE_OK; 19 - } 20 - 21 13 static bool is_thinkpad(struct hda_codec *codec) 22 14 { 23 - bool found = false; 24 - if (codec->core.subsystem_id >> 16 != 0x17aa) 25 - return false; 26 - if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found) 27 - return true; 28 - found = false; 29 - return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found; 15 + return (codec->core.subsystem_id >> 16 == 0x17aa) && 16 + (acpi_dev_present("LEN0068") || acpi_dev_present("IBM0068")); 30 17 } 31 18 32 19 static void update_tpacpi_mute_led(void *private_data, int enabled)