ACPICA: Major update for acpi_get_object_info external interface
[safe/jmp/linux-2.6] / drivers / acpi / acpica / evrgnini.c
index f3f1fb4..cf29c49 100644 (file)
@@ -50,8 +50,6 @@
 ACPI_MODULE_NAME("evrgnini")
 
 /* Local prototypes */
-static u8 acpi_ev_match_pci_root_bridge(char *id);
-
 static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node);
 
 /*******************************************************************************
@@ -241,7 +239,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
                                                status = AE_OK;
                                        } else {
                                                ACPI_EXCEPTION((AE_INFO, status,
-                                                               "Could not install PciConfig handler for Root Bridge %4.4s",
+                                                               "Could not install PciConfig handler "
+                                                               "for Root Bridge %4.4s",
                                                                acpi_ut_get_node_name
                                                                (pci_root_node)));
                                        }
@@ -293,9 +292,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
         * Get the PCI device and function numbers from the _ADR object contained
         * in the parent's scope.
         */
-       status =
-           acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node,
-                                           &pci_value);
+       status = acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR,
+                                                pci_device_node, &pci_value);
 
        /*
         * The default is zero, and since the allocation above zeroed the data,
@@ -308,18 +306,16 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
 
        /* The PCI segment number comes from the _SEG method */
 
-       status =
-           acpi_ut_evaluate_numeric_object(METHOD_NAME__SEG, pci_root_node,
-                                           &pci_value);
+       status = acpi_ut_evaluate_numeric_object(METHOD_NAME__SEG,
+                                                pci_root_node, &pci_value);
        if (ACPI_SUCCESS(status)) {
                pci_id->segment = ACPI_LOWORD(pci_value);
        }
 
        /* The PCI bus number comes from the _BBN method */
 
-       status =
-           acpi_ut_evaluate_numeric_object(METHOD_NAME__BBN, pci_root_node,
-                                           &pci_value);
+       status = acpi_ut_evaluate_numeric_object(METHOD_NAME__BBN,
+                                                pci_root_node, &pci_value);
        if (ACPI_SUCCESS(status)) {
                pci_id->bus = ACPI_LOWORD(pci_value);
        }
@@ -334,37 +330,6 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ev_match_pci_root_bridge
- *
- * PARAMETERS:  Id              - The HID/CID in string format
- *
- * RETURN:      TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
- *
- * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
- *
- ******************************************************************************/
-
-static u8 acpi_ev_match_pci_root_bridge(char *id)
-{
-
-       /*
-        * Check if this is a PCI root.
-        * ACPI 3.0+: check for a PCI Express root also.
-        */
-       if (!(ACPI_STRNCMP(id,
-                          PCI_ROOT_HID_STRING,
-                          sizeof(PCI_ROOT_HID_STRING))) ||
-           !(ACPI_STRNCMP(id,
-                          PCI_EXPRESS_ROOT_HID_STRING,
-                          sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) {
-               return (TRUE);
-       }
-
-       return (FALSE);
-}
-
-/*******************************************************************************
- *
  * FUNCTION:    acpi_ev_is_pci_root_bridge
  *
  * PARAMETERS:  Node            - Device node being examined
@@ -379,9 +344,10 @@ static u8 acpi_ev_match_pci_root_bridge(char *id)
 static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
 {
        acpi_status status;
-       struct acpica_device_id hid;
-       struct acpi_compatible_id_list *cid;
+       struct acpica_device_id *hid;
+       struct acpica_device_id_list *cid;
        u32 i;
+       u8 match;
 
        /* Get the _HID and check for a PCI Root Bridge */
 
@@ -390,7 +356,10 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
                return (FALSE);
        }
 
-       if (acpi_ev_match_pci_root_bridge(hid.value)) {
+       match = acpi_ut_is_pci_root_bridge(hid->string);
+       ACPI_FREE(hid);
+
+       if (match) {
                return (TRUE);
        }
 
@@ -404,7 +373,7 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
        /* Check all _CIDs in the returned list */
 
        for (i = 0; i < cid->count; i++) {
-               if (acpi_ev_match_pci_root_bridge(cid->id[i].value)) {
+               if (acpi_ut_is_pci_root_bridge(cid->ids[i].string)) {
                        ACPI_FREE(cid);
                        return (TRUE);
                }
@@ -632,8 +601,8 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
                                                                  acpi_ns_locked);
 
                                        /*
-                                        * Tell all users that this region is usable by running the _REG
-                                        * method
+                                        * Tell all users that this region is usable by
+                                        * running the _REG method
                                         */
                                        if (acpi_ns_locked) {
                                                status =