From patchwork Mon Nov 23 14:34:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 7682841 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7BFABF90C for ; Mon, 23 Nov 2015 14:44:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 023F02073E for ; Mon, 23 Nov 2015 14:44:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A5DD20732 for ; Mon, 23 Nov 2015 14:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbbKWOoz (ORCPT ); Mon, 23 Nov 2015 09:44:55 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:49462 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964AbbKWOoy (ORCPT ); Mon, 23 Nov 2015 09:44:54 -0500 X-Greylist: delayed 587 seconds by postgrey-1.27 at vger.kernel.org; Mon, 23 Nov 2015 09:44:54 EST Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout3.hostsharing.net (Postfix) with ESMTPS id 0A45910363499; Mon, 23 Nov 2015 15:36:38 +0100 (CET) Received: from localhost (6-38-90-81.adsl.cmo.de [81.90.38.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id D6E46603E044; Mon, 23 Nov 2015 15:36:36 +0100 (CET) X-Mailbox-Line: From 515643b09b28cd6b4445a1ff194bf62b0d02989c Mon Sep 17 00:00:00 2001 Message-Id: <515643b09b28cd6b4445a1ff194bf62b0d02989c.1448282995.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Mon, 23 Nov 2015 15:34:55 +0100 Subject: [PATCH 4/5] ALSA: hda - Use acpi_dev_present To: linux-acpi@vger.kernel.org, devel@acpica.org Cc: alsa-devel@alsa-project.org, Takashi Iwai , Hui Wang Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use shiny new acpi_dev_present and remove all the boilerplate to search for a particular ACPI device. No functional change. Cc: Hui Wang Cc: Takashi Iwai Signed-off-by: Lukas Wunner Acked-by: Hui Wang --- sound/pci/hda/thinkpad_helper.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c index 0a4ad5f..59ab6ce 100644 --- a/sound/pci/hda/thinkpad_helper.c +++ b/sound/pci/hda/thinkpad_helper.c @@ -10,23 +10,10 @@ static int (*led_set_func)(int, bool); 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) { - bool found = false; - if (codec->core.subsystem_id >> 16 != 0x17aa) - 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; + return (codec->core.subsystem_id >> 16 == 0x17aa) && + (acpi_dev_present("LEN0068") || acpi_dev_present("IBM0068")); } static void update_tpacpi_mute_led(void *private_data, int enabled)