Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95593
b: refs/heads/master
c: d152cf5
h: refs/heads/master
i:
  95591: f389ff0
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Apr 29, 2008
1 parent fb67017 commit f70905a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01115e7d41c4eaeffa064d818b4abbd3efa94f80
refs/heads/master: d152cf5d0c3325979e71ee53b425fdd51a1a285a
24 changes: 5 additions & 19 deletions trunk/drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ static int __init ispnpidacpi(char *id)

static int pnpacpi_get_resources(struct pnp_dev *dev)
{
acpi_status status;

dev_dbg(&dev->dev, "get resources\n");
status = pnpacpi_parse_allocated_resource(dev);
return ACPI_FAILURE(status) ? -ENODEV : 0;
return pnpacpi_parse_allocated_resource(dev);
}

static int pnpacpi_set_resources(struct pnp_dev *dev)
Expand Down Expand Up @@ -182,22 +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(dev);
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(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;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/pnp/pnpacpi/pnpacpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <linux/acpi.h>
#include <linux/pnp.h>

acpi_status pnpacpi_parse_allocated_resource(struct pnp_dev *);
acpi_status pnpacpi_parse_resource_option_data(struct pnp_dev *);
int pnpacpi_parse_allocated_resource(struct pnp_dev *);
int pnpacpi_parse_resource_option_data(struct pnp_dev *);
int pnpacpi_encode_resources(struct pnp_dev *, struct acpi_buffer *);
int pnpacpi_build_resource_template(struct pnp_dev *, struct acpi_buffer *);
#endif
30 changes: 22 additions & 8 deletions trunk/drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,24 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
return AE_OK;
}

acpi_status pnpacpi_parse_allocated_resource(struct pnp_dev *dev)
int pnpacpi_parse_allocated_resource(struct pnp_dev *dev)
{
acpi_handle handle = dev->data;
acpi_status status;

dev_dbg(&dev->dev, "parse allocated resources\n");

pnp_init_resources(dev);

return acpi_walk_resources(handle, METHOD_NAME__CRS,
pnpacpi_allocated_resource, dev);
status = acpi_walk_resources(handle, METHOD_NAME__CRS,
pnpacpi_allocated_resource, dev);

if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND)
dev_err(&dev->dev, "can't evaluate _CRS: %d", status);
return -EPERM;
}
return 0;
}

static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev,
Expand Down Expand Up @@ -670,7 +678,7 @@ static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
return AE_OK;
}

acpi_status __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev)
int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev)
{
acpi_handle handle = dev->data;
acpi_status status;
Expand All @@ -680,13 +688,19 @@ acpi_status __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev)

parse_data.option = pnp_register_independent_option(dev);
if (!parse_data.option)
return AE_ERROR;
return -ENOMEM;

parse_data.option_independent = parse_data.option;
parse_data.dev = dev;
status = acpi_walk_resources(handle, METHOD_NAME__PRS,
pnpacpi_option_resource, &parse_data);

return status;
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND)
dev_err(&dev->dev, "can't evaluate _PRS: %d", status);
return -EPERM;
}
return 0;
}

static int pnpacpi_supported_resource(struct acpi_resource *res)
Expand Down Expand Up @@ -745,7 +759,7 @@ int pnpacpi_build_resource_template(struct pnp_dev *dev,
status = acpi_walk_resources(handle, METHOD_NAME__CRS,
pnpacpi_count_resources, &res_cnt);
if (ACPI_FAILURE(status)) {
dev_err(&dev->dev, "can't evaluate _CRS\n");
dev_err(&dev->dev, "can't evaluate _CRS: %d\n", status);
return -EINVAL;
}
if (!res_cnt)
Expand All @@ -760,7 +774,7 @@ int pnpacpi_build_resource_template(struct pnp_dev *dev,
pnpacpi_type_resources, &resource);
if (ACPI_FAILURE(status)) {
kfree(buffer->pointer);
dev_err(&dev->dev, "can't evaluate _CRS\n");
dev_err(&dev->dev, "can't evaluate _CRS: %d\n", status);
return -EINVAL;
}
/* resource will pointer the end resource now */
Expand Down

0 comments on commit f70905a

Please sign in to comment.