From patchwork Tue Feb 26 15:25:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2185871 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C1115DFABD for ; Tue, 26 Feb 2013 15:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759632Ab3BZPcr (ORCPT ); Tue, 26 Feb 2013 10:32:47 -0500 Received: from mail-pb0-f43.google.com ([209.85.160.43]:54002 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759465Ab3BZPcp (ORCPT ); Tue, 26 Feb 2013 10:32:45 -0500 Received: by mail-pb0-f43.google.com with SMTP id md12so2449164pbc.16 for ; Tue, 26 Feb 2013 07:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Nr+KiJKfetVmLU2u6PsbqrgJ38tYS5oYnw7+Es+x2OE=; b=vb4kiJO75FzSNiYPLOP3ttB6t1zKWF0SPbY/FM9CVEuIhXf4CcJ/MroLfBhILzTNZi 7LT35GqfsUw9PQbhTOjAXw+WvlNS3TGXtJt94uRPHXw49/Ophe59bUD+2d/nGGukW7dY BHgALG8IiujcZmij+k7AEcbeyVLUILjunnEOYnl+hnSVlrA3nAVlkgD1/z9Kn81iu7pi Nj87OsGZGFc2ck6ezAQhmjqds2BR5UxWQvyABpo2nJFjKkez8FsotdcN0biSr6ma3Pf5 nVstu2VwZr8X64x/h7qq+5bgKsdwNk0YT1xL+bx1hm4Wla/IgdFk/Xfi0tmiKgopobD0 C/Jg== X-Received: by 10.66.157.100 with SMTP id wl4mr2368344pab.84.1361892764173; Tue, 26 Feb 2013 07:32:44 -0800 (PST) Received: from localhost.localdomain ([114.250.77.63]) by mx.google.com with ESMTPS id gg7sm1229055pbc.45.2013.02.26.07.32.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Feb 2013 07:32:43 -0800 (PST) From: Jiang Liu To: Bjorn Helgaas , "Rafael J . Wysocki" Cc: Myron Stowe , Yinghai Lu , Yijing Wang , Jiang Liu , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Greg Kroah-Hartman , ACPI Devel Maling List , Toshi Kani , Jiang Liu , "Rafael J. Wysocki" Subject: [PATCH v8 13/13] PCI, ACPI: remove support of ACPI PCI subdrivers Date: Tue, 26 Feb 2013 23:25:53 +0800 Message-Id: <1361892353-14786-14-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1361892353-14786-1-git-send-email-jiang.liu@huawei.com> References: <1361892353-14786-1-git-send-email-jiang.liu@huawei.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Myron Stowe Both sub-drivers of the "PCI Root Bridge ("pci_bridge")" driver, "acpiphp" and "pci_slot", have been converted to hook directly into the PCI core. With the conversions there are no remaining usages of the 'struct acpi_pci_driver' list based infrastructure. This patch removes it. Signed-off-by: Myron Stowe Signed-off-by: Jiang Liu Cc: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Toshi Kani Cc: linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Yinghai Lu --- drivers/acpi/pci_root.c | 48 +---------------------------------------------- include/linux/acpi.h | 9 --------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 8b5a73b..2ef0c91 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -69,44 +69,12 @@ static struct acpi_driver acpi_pci_root_driver = { }, }; -/* Lock to protect both acpi_pci_roots and acpi_pci_drivers lists */ +/* Lock to protect both acpi_pci_roots lists */ static DEFINE_MUTEX(acpi_pci_root_lock); static LIST_HEAD(acpi_pci_roots); -static LIST_HEAD(acpi_pci_drivers); static DEFINE_MUTEX(osc_lock); -int acpi_pci_register_driver(struct acpi_pci_driver *driver) -{ - int n = 0; - struct acpi_pci_root *root; - - mutex_lock(&acpi_pci_root_lock); - list_add_tail(&driver->node, &acpi_pci_drivers); - if (driver->add) - list_for_each_entry(root, &acpi_pci_roots, node) { - driver->add(root); - n++; - } - mutex_unlock(&acpi_pci_root_lock); - - return n; -} -EXPORT_SYMBOL(acpi_pci_register_driver); - -void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) -{ - struct acpi_pci_root *root; - - mutex_lock(&acpi_pci_root_lock); - list_del(&driver->node); - if (driver->remove) - list_for_each_entry(root, &acpi_pci_roots, node) - driver->remove(root); - mutex_unlock(&acpi_pci_root_lock); -} -EXPORT_SYMBOL(acpi_pci_unregister_driver); - /** * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge * @handle - the ACPI CA node in question. @@ -416,7 +384,6 @@ static int acpi_pci_root_add(struct acpi_device *device) acpi_status status; int result; struct acpi_pci_root *root; - struct acpi_pci_driver *driver; u32 flags, base_flags; bool is_osc_granted = false; @@ -576,12 +543,6 @@ static int acpi_pci_root_add(struct acpi_device *device) pci_assign_unassigned_bus_resources(root->bus); } - mutex_lock(&acpi_pci_root_lock); - list_for_each_entry(driver, &acpi_pci_drivers, node) - if (driver->add) - driver->add(root); - mutex_unlock(&acpi_pci_root_lock); - /* need to after hot-added ioapic is registered */ if (system_state != SYSTEM_BOOTING) pci_enable_bridges(root->bus); @@ -602,16 +563,9 @@ end: static int acpi_pci_root_remove(struct acpi_device *device, int type) { struct acpi_pci_root *root = acpi_driver_data(device); - struct acpi_pci_driver *driver; pci_stop_root_bus(root->bus); - mutex_lock(&acpi_pci_root_lock); - list_for_each_entry_reverse(driver, &acpi_pci_drivers, node) - if (driver->remove) - driver->remove(root); - mutex_unlock(&acpi_pci_root_lock); - device_set_run_wake(root->bus->bridge, false); pci_acpi_remove_bus_pm_notifier(device); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 8c1d6f2..eeb5600 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -147,15 +147,6 @@ void acpi_penalize_isa_irq(int irq, int active); void acpi_pci_irq_disable (struct pci_dev *dev); -struct acpi_pci_driver { - struct list_head node; - int (*add)(struct acpi_pci_root *root); - void (*remove)(struct acpi_pci_root *root); -}; - -int acpi_pci_register_driver(struct acpi_pci_driver *driver); -void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); - extern int ec_read(u8 addr, u8 *val); extern int ec_write(u8 addr, u8 val); extern int ec_transaction(u8 command,