]> err.no Git - linux-2.6/blobdiff - drivers/pnp/pnpacpi/core.c
Merge branches 'ns9x' and 'machtypes' into devel
[linux-2.6] / drivers / pnp / pnpacpi / core.c
index 590fbcb0ee89852fa3b250acd2810880dfb1c8de..50902773beaf9092fd0a241d535835a8839c843b 100644 (file)
@@ -45,7 +45,7 @@ static struct acpi_device_id excluded_id_list[] __initdata = {
        {"", 0},
 };
 
-static inline int is_exclusive_device(struct acpi_device *dev)
+static inline int __init is_exclusive_device(struct acpi_device *dev)
 {
        return (!acpi_match_device_ids(dev, excluded_id_list));
 }
@@ -75,11 +75,8 @@ static int __init ispnpidacpi(char *id)
 
 static int pnpacpi_get_resources(struct pnp_dev *dev)
 {
-       acpi_status status;
-
-       status = pnpacpi_parse_allocated_resource((acpi_handle) dev->data,
-                                                 &dev->res);
-       return ACPI_FAILURE(status) ? -ENODEV : 0;
+       dev_dbg(&dev->dev, "get resources\n");
+       return pnpacpi_parse_allocated_resource(dev);
 }
 
 static int pnpacpi_set_resources(struct pnp_dev *dev)
@@ -89,10 +86,11 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
        int ret;
        acpi_status status;
 
+       dev_dbg(&dev->dev, "set resources\n");
        ret = pnpacpi_build_resource_template(dev, &buffer);
        if (ret)
                return ret;
-       ret = pnpacpi_encode_resources(&dev->res, &buffer);
+       ret = pnpacpi_encode_resources(dev, &buffer);
        if (ret) {
                kfree(buffer.pointer);
                return ret;
@@ -181,24 +179,11 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
        else
                strncpy(dev->name, acpi_device_bid(device), sizeof(dev->name));
 
-       if (dev->active) {
-               /* parse allocated resource */
-               status = pnpacpi_parse_allocated_resource(device->handle,
-                                                         &dev->res);
-               if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-                       pnp_err("PnPACPI: METHOD_NAME__CRS failure for %s",
-                               acpi_device_hid(device));
-               }
-       }
+       if (dev->active)
+               pnpacpi_parse_allocated_resource(dev);
 
-       if (dev->capabilities & PNP_CONFIGURABLE) {
-               status = pnpacpi_parse_resource_option_data(device->handle,
-                                                           dev);
-               if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
-                       pnp_err("PnPACPI: METHOD_NAME__PRS failure for %s",
-                               acpi_device_hid(device));
-               }
-       }
+       if (dev->capabilities & PNP_CONFIGURABLE)
+               pnpacpi_parse_resource_option_data(dev);
 
        if (device->flags.compatible_ids) {
                struct acpi_compatible_id_list *cid_list = device->pnp.cid_list;
@@ -213,7 +198,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
 
        /* clear out the damaged flags */
        if (!dev->active)
-               pnp_init_resource_table(&dev->res);
+               pnp_init_resources(dev);
        pnp_add_device(dev);
        num++;