Commit cdef6254 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

PNPACPI: pass pnp_dev instead of acpi_handle

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: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: default avatarRene Herman <rene.herman@gmail.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent cd7ec927
...@@ -88,10 +88,10 @@ static int pnpacpi_set_resources(struct pnp_dev *dev, ...@@ -88,10 +88,10 @@ static int pnpacpi_set_resources(struct pnp_dev *dev,
{ {
acpi_handle handle = dev->data; acpi_handle handle = dev->data;
struct acpi_buffer buffer; struct acpi_buffer buffer;
int ret = 0; int ret;
acpi_status status; acpi_status status;
ret = pnpacpi_build_resource_template(handle, &buffer); ret = pnpacpi_build_resource_template(dev, &buffer);
if (ret) if (ret)
return ret; return ret;
ret = pnpacpi_encode_resources(res, &buffer); ret = pnpacpi_encode_resources(res, &buffer);
......
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
acpi_status pnpacpi_parse_allocated_resource(acpi_handle, struct pnp_resource_table*); acpi_status pnpacpi_parse_allocated_resource(acpi_handle, struct pnp_resource_table*);
acpi_status pnpacpi_parse_resource_option_data(acpi_handle, struct pnp_dev*); 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_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 #endif
...@@ -777,9 +777,10 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data) ...@@ -777,9 +777,10 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
return AE_OK; return AE_OK;
} }
int pnpacpi_build_resource_template(acpi_handle handle, int pnpacpi_build_resource_template(struct pnp_dev *dev,
struct acpi_buffer *buffer) struct acpi_buffer *buffer)
{ {
acpi_handle handle = dev->data;
struct acpi_resource *resource; struct acpi_resource *resource;
int res_cnt = 0; int res_cnt = 0;
acpi_status status; acpi_status status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment