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: 7682851 Return-Path: X-Original-To: patchwork-platform-driver-x86@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 6C66BBF90C for ; Mon, 23 Nov 2015 14:44:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AF0720729 for ; Mon, 23 Nov 2015 14:44:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03A2F2073F for ; Mon, 23 Nov 2015 14:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754002AbbKWOoz (ORCPT ); Mon, 23 Nov 2015 09:44:55 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:46745 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420AbbKWOoz (ORCPT ); Mon, 23 Nov 2015 09:44:55 -0500 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 6EE1C1035DE5C; Mon, 23 Nov 2015 15:36:15 +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 2EA5B603E044; Mon, 23 Nov 2015 15:36:14 +0100 (CET) X-Mailbox-Line: From 16567313cc5fe318e4738ecd9442c04432f7e8cb Mon Sep 17 00:00:00 2001 Message-Id: <16567313cc5fe318e4738ecd9442c04432f7e8cb.1448282995.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Mon, 23 Nov 2015 15:34:55 +0100 Subject: [PATCH 3/5] acer-wmi: Use acpi_dev_present To: linux-acpi@vger.kernel.org, devel@acpica.org Cc: platform-driver-x86@vger.kernel.org, Darren Hart , "Lee, Chun-Yi" Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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: Lee, Chun-Yi Signed-off-by: Lukas Wunner Acked-by: Darren Hart --- drivers/platform/x86/acer-wmi.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 1062fa4..3deadd5 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -793,15 +793,6 @@ static acpi_status __init AMW0_find_mailled(void) return AE_OK; } -static int AMW0_set_cap_acpi_check_device_found __initdata; - -static acpi_status __init AMW0_set_cap_acpi_check_device_cb(acpi_handle handle, - u32 level, void *context, void **retval) -{ - AMW0_set_cap_acpi_check_device_found = 1; - return AE_OK; -} - static const struct acpi_device_id norfkill_ids[] __initconst = { { "VPC2004", 0}, { "IBM0068", 0}, @@ -816,9 +807,10 @@ static int __init AMW0_set_cap_acpi_check_device(void) const struct acpi_device_id *id; for (id = norfkill_ids; id->id[0]; id++) - acpi_get_devices(id->id, AMW0_set_cap_acpi_check_device_cb, - NULL, NULL); - return AMW0_set_cap_acpi_check_device_found; + if (acpi_dev_present(id->id)) + return true; + + return false; } static acpi_status __init AMW0_set_capabilities(void)