]> err.no Git - linux-2.6/commitdiff
PNPACPI: pass pnp_dev instead of acpi_handle
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Mon, 28 Apr 2008 22:34:03 +0000 (16:34 -0600)
committerLen Brown <len.brown@intel.com>
Tue, 29 Apr 2008 07:22:19 +0000 (03:22 -0400)
Pass the pnp_dev pointer when possible instead of the acpi_handle.
This allows better error messages and reduces the chance of error
in the caller.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/pnp/pnpacpi/core.c
drivers/pnp/pnpacpi/pnpacpi.h
drivers/pnp/pnpacpi/rsparser.c

index fd3fca6dddd3b3885b7fc6e0efd36c158da2121b..27546873880c7fa0ad79f04258cf4633923d0342 100644 (file)
@@ -88,10 +88,10 @@ static int pnpacpi_set_resources(struct pnp_dev *dev,
 {
        acpi_handle handle = dev->data;
        struct acpi_buffer buffer;
-       int ret = 0;
+       int ret;
        acpi_status status;
 
-       ret = pnpacpi_build_resource_template(handle, &buffer);
+       ret = pnpacpi_build_resource_template(dev, &buffer);
        if (ret)
                return ret;
        ret = pnpacpi_encode_resources(res, &buffer);
index f28e2ed66fa34e6e1d2de9fa8ea1262ad703103d..116c591d86340b1af7ef196967dc20f29189e872 100644 (file)
@@ -8,5 +8,5 @@
 acpi_status pnpacpi_parse_allocated_resource(acpi_handle, struct pnp_resource_table*);
 acpi_status pnpacpi_parse_resource_option_data(acpi_handle, struct pnp_dev*);
 int pnpacpi_encode_resources(struct pnp_resource_table *, struct acpi_buffer *);
-int pnpacpi_build_resource_template(acpi_handle, struct acpi_buffer*);
+int pnpacpi_build_resource_template(struct pnp_dev *, struct acpi_buffer *);
 #endif
index a5f5e2130e75cd12cb578256663e0f32d2b8ec09..baaf602127793ecc05c0016773872273da6029ee 100644 (file)
@@ -777,9 +777,10 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
        return AE_OK;
 }
 
-int pnpacpi_build_resource_template(acpi_handle handle,
+int pnpacpi_build_resource_template(struct pnp_dev *dev,
                                    struct acpi_buffer *buffer)
 {
+       acpi_handle handle = dev->data;
        struct acpi_resource *resource;
        int res_cnt = 0;
        acpi_status status;