Skip to content

Commit

Permalink
PNPACPI: pass pnp_dev instead of acpi_handle
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-By: Rene Herman <[email protected]>
Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
Bjorn Helgaas authored and lenb committed Apr 29, 2008
1 parent cd7ec92 commit cdef625
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/pnp/pnpacpi/pnpacpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cdef625

Please sign in to comment.