From patchwork Sat May 27 05:31:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 9751505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4445660393 for ; Sat, 27 May 2017 05:32:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3639F26538 for ; Sat, 27 May 2017 05:32:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AC8728408; Sat, 27 May 2017 05:32:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BEF328403 for ; Sat, 27 May 2017 05:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750903AbdE0Fbm (ORCPT ); Sat, 27 May 2017 01:31:42 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:55348 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbdE0Fbk (ORCPT ); Sat, 27 May 2017 01:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A/KwGaNKjN1xE8nbrz0vqenaYUNnpXPzM/cSCin99k4=; b=FU6uHRwAEqOk3zUm47Xt9GzJE sJ5GX3uPp5pLsOSN3w/ocgvU1tUvb/LZJuCkzvK8CzmUfEWEOeTAlHx86vfEQmbuoScDtjkw0FjuB W9o30fvF1EjwvEvnZiVktCvR+Cfu3gAi+xjTvUs6U1Izaa0v3/MA+pOXt0Rzf+q6Ph6NUUFr9HCff YIe1awbz0EMQNSl5cDI64VZsrTn2ghH95L4B3Eipi5ehyne9XGCWRrCKIN+o8GiJmF1bhU7QVKp7a +9qs2FZ9HveDRu+3vVBrOKy1B8dr+W3auUatOiL9sbHeazqtQOGZJfiftaBdgGNV5b7iWB0gYOivP ujFwklTKw==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.87 #1 (Red Hat Linux)) id 1dEUKC-0000cj-8I; Sat, 27 May 2017 05:31:40 +0000 From: Darren Hart To: platform-driver-x86@vger.kernel.org Cc: Andy Shevchenko , Andy Lutomirski , Andy Lutomirski , Mario Limonciello , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Rafael Wysocki , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Darren Hart Subject: [PATCH 02/16] platform/x86: wmi: Pass the acpi_device through to parse_wdg Date: Fri, 26 May 2017 22:31:16 -0700 Message-Id: <4f0f31a62d3f91fa38fc5762cb9340e85c8fb124.1495862272.git.dvhart@infradead.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Lutomirski We will need the device to convert to a bus architecture and bind WMI to the platform device. Signed-off-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Mario Limonciello Cc: Pali Rohár Cc: Rafael Wysocki Cc: linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Cc: linux-acpi@vger.kernel.org Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/wmi.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 0043581..c6e11b5 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -606,7 +606,8 @@ static struct class wmi_class = { }; static int wmi_create_device(const struct guid_block *gblock, - struct wmi_block *wblock, acpi_handle handle) + struct wmi_block *wblock, + struct acpi_device *device) { wblock->dev.class = &wmi_class; @@ -645,7 +646,7 @@ static bool guid_already_parsed(const char *guid_string) /* * Parse the _WDG method for the GUID data blocks */ -static int parse_wdg(acpi_handle handle) +static int parse_wdg(struct acpi_device *device) { struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; union acpi_object *obj; @@ -655,7 +656,7 @@ static int parse_wdg(acpi_handle handle) int retval; u32 i, total; - status = acpi_evaluate_object(handle, "_WDG", NULL, &out); + status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out); if (ACPI_FAILURE(status)) return -ENXIO; @@ -679,7 +680,7 @@ static int parse_wdg(acpi_handle handle) if (!wblock) return -ENOMEM; - wblock->handle = handle; + wblock->handle = device->handle; wblock->gblock = gblock[i]; /* @@ -689,7 +690,7 @@ static int parse_wdg(acpi_handle handle) for device creation. */ if (!guid_already_parsed(gblock[i].guid)) { - retval = wmi_create_device(&gblock[i], wblock, handle); + retval = wmi_create_device(&gblock[i], wblock, device); if (retval) { wmi_free_devices(); goto out_free_pointer; @@ -806,7 +807,7 @@ static int acpi_wmi_add(struct acpi_device *device) return -ENODEV; } - error = parse_wdg(device->handle); + error = parse_wdg(device); if (error) { acpi_remove_address_space_handler(device->handle, ACPI_ADR_SPACE_EC,