]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/acpi/pci_root.c
dmaengine: ste_dma40: fix error return code in d40_probe()
[karo-tx-linux.git] / drivers / acpi / pci_root.c
index 6ae5e440436ef46a9ca518303575fa31963cb23f..1dd6f6c8587442ab1fcbdf7d7bd78d98ef551a9b 100644 (file)
@@ -65,44 +65,12 @@ static struct acpi_scan_handler pci_root_handler = {
        .detach = acpi_pci_root_remove,
 };
 
-/* 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.
@@ -201,8 +169,8 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root,
                *control &= OSC_PCI_CONTROL_MASKS;
                capbuf[OSC_CONTROL_TYPE] = *control | root->osc_control_set;
        } else {
-               /* Run _OSC query for all possible controls. */
-               capbuf[OSC_CONTROL_TYPE] = OSC_PCI_CONTROL_MASKS;
+               /* Run _OSC query only with existing controls. */
+               capbuf[OSC_CONTROL_TYPE] = root->osc_control_set;
        }
 
        status = acpi_pci_run_osc(root->device->handle, capbuf, &result);
@@ -413,7 +381,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;
 
        root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
@@ -571,12 +538,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);
@@ -597,16 +558,9 @@ end:
 static void acpi_pci_root_remove(struct acpi_device *device)
 {
        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);