From patchwork Sun Feb 2 00:31:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 3565431 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 25143C02DC for ; Sun, 2 Feb 2014 00:18:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42AD220279 for ; Sun, 2 Feb 2014 00:18:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F2A020266 for ; Sun, 2 Feb 2014 00:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754711AbaBBASR (ORCPT ); Sat, 1 Feb 2014 19:18:17 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:59233 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754331AbaBBASQ (ORCPT ); Sat, 1 Feb 2014 19:18:16 -0500 Received: from aept186.neoplus.adsl.tpnet.pl [79.191.149.186] (HELO vostro.rjw.lan) by serwer1319399.home.pl [79.96.170.134] with SMTP (IdeaSmtpServer v0.80) id 0690173497be4693; Sun, 2 Feb 2014 01:18:14 +0100 From: "Rafael J. Wysocki" To: ACPI Devel Maling List Cc: Bjorn Helgaas , Aaron Lu , Linux Kernel Mailing List , Linux PCI , Mika Westerberg Subject: [PATCH v2 13/13] ACPI / hotplug: Do not pass ACPI handles to ACPI dock operations Date: Sun, 02 Feb 2014 01:31:48 +0100 Message-ID: <5610827.AznebXRq6q@vostro.rjw.lan> User-Agent: KMail/4.11.4 (Linux/3.13.0+; KDE/4.11.4; x86_64; ; ) In-Reply-To: <1935791.liE9ZlzmO9@vostro.rjw.lan> References: <2217793.001RY6hKlo@vostro.rjw.lan> <1935791.liE9ZlzmO9@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Rafael J. Wysocki None of the existing users of struct acpi_dock_ops actually needs the first argument of its member functions, so redefine those functions to take only two arguments, the event type and data pointer, and update the users of struct acpi_dock_ops accordingly. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/dock.c | 4 ++-- drivers/ata/libata-acpi.c | 8 ++++---- drivers/pci/hotplug/acpiphp_glue.c | 13 +++++++------ include/acpi/acpi_drivers.h | 6 +++--- 4 files changed, 16 insertions(+), 15 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/include/acpi/acpi_drivers.h =================================================================== --- linux-pm.orig/include/acpi/acpi_drivers.h +++ linux-pm/include/acpi/acpi_drivers.h @@ -110,9 +110,9 @@ void pci_acpi_crs_quirks(void); Dock Station -------------------------------------------------------------------------- */ struct acpi_dock_ops { - acpi_notify_handler fixup; - acpi_notify_handler handler; - acpi_notify_handler uevent; + void (*handler)(u32 event_type, void *data); + void (*fixup)(u32 event_type, void *data); + void (*uevent)(u32 event_type, void *data); }; #ifdef CONFIG_ACPI_DOCK Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c =================================================================== --- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c +++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c @@ -63,7 +63,7 @@ static DEFINE_MUTEX(acpiphp_context_lock static void handle_hotplug_event(acpi_handle handle, u32 type, void *data); static void acpiphp_sanitize_bus(struct pci_bus *bus); static void acpiphp_set_hpp_values(struct pci_bus *bus); -static void hotplug_event(acpi_handle handle, u32 type, void *data); +static void hotplug_event(u32 type, void *data); static void free_bridge(struct kref *kref); static void acpiphp_context_handler(acpi_handle handle, void *context) @@ -185,7 +185,7 @@ static void free_bridge(struct kref *kre * TBD - figure out a way to only call fixups for * systems that require them. */ -static void post_dock_fixups(acpi_handle not_used, u32 event, void *data) +static void post_dock_fixups(u32 event, void *data) { struct acpiphp_context *context = data; struct pci_bus *bus = context->func.slot->bus; @@ -788,11 +788,12 @@ void acpiphp_check_host_bridge(acpi_hand static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot); -static void hotplug_event(acpi_handle handle, u32 type, void *data) +static void hotplug_event(u32 type, void *data) { struct acpiphp_context *context = data; struct acpiphp_func *func = &context->func; struct acpiphp_slot *slot = func->slot; + acpi_handle handle = context->adev->handle; struct acpiphp_bridge *bridge; mutex_lock(&acpiphp_context_lock); @@ -845,14 +846,14 @@ static void hotplug_event(acpi_handle ha static void hotplug_event_work(void *data, u32 type) { struct acpiphp_context *context = data; - acpi_handle handle = context->adev->handle; acpi_scan_lock_acquire(); - hotplug_event(handle, type, context); + hotplug_event(type, context); acpi_scan_lock_release(); - acpi_evaluate_hotplug_ost(handle, type, ACPI_OST_SC_SUCCESS, NULL); + acpi_evaluate_hotplug_ost(context->adev->handle, type, + ACPI_OST_SC_SUCCESS, NULL); put_bridge(context->func.parent); } Index: linux-pm/drivers/acpi/dock.c =================================================================== --- linux-pm.orig/drivers/acpi/dock.c +++ linux-pm/drivers/acpi/dock.c @@ -185,7 +185,7 @@ static void dock_release_hotplug(struct static void dock_hotplug_event(struct dock_dependent_device *dd, u32 event, enum dock_callback_type cb_type) { - acpi_notify_handler cb = NULL; + void (*cb)(u32, void *) = NULL; bool run = false; mutex_lock(&hotplug_lock); @@ -213,7 +213,7 @@ static void dock_hotplug_event(struct do return; if (cb) - cb(dd->handle, event, dd->hp_context); + cb(event, dd->hp_context); dock_release_hotplug(dd); } Index: linux-pm/drivers/ata/libata-acpi.c =================================================================== --- linux-pm.orig/drivers/ata/libata-acpi.c +++ linux-pm/drivers/ata/libata-acpi.c @@ -121,14 +121,14 @@ static void ata_acpi_handle_hotplug(stru ata_port_wait_eh(ap); } -static void ata_acpi_dev_notify_dock(acpi_handle handle, u32 event, void *data) +static void ata_acpi_dev_notify_dock(u32 event, void *data) { struct ata_device *dev = data; ata_acpi_handle_hotplug(dev->link->ap, dev, event); } -static void ata_acpi_ap_notify_dock(acpi_handle handle, u32 event, void *data) +static void ata_acpi_ap_notify_dock(u32 event, void *data) { struct ata_port *ap = data; @@ -154,12 +154,12 @@ static void ata_acpi_uevent(struct ata_p } } -static void ata_acpi_ap_uevent(acpi_handle handle, u32 event, void *data) +static void ata_acpi_ap_uevent(u32 event, void *data) { ata_acpi_uevent(data, NULL, event); } -static void ata_acpi_dev_uevent(acpi_handle handle, u32 event, void *data) +static void ata_acpi_dev_uevent(u32 event, void *data) { struct ata_device *dev = data; ata_acpi_uevent(dev->link->ap, dev, event);