Skip to content

Commit

Permalink
Merge branch 'pnpacpi' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Len Brown committed Apr 5, 2009
2 parents 2e33b23 + 6328a57 commit 47ae106
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
acpi_handle handle = dev->data;
struct acpi_buffer buffer;
int ret;
acpi_status status;

pnp_dbg(&dev->dev, "set resources\n");
ret = pnpacpi_build_resource_template(dev, &buffer);
Expand All @@ -94,21 +93,31 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
kfree(buffer.pointer);
return ret;
}
status = acpi_set_current_resources(handle, &buffer);
if (ACPI_FAILURE(status))
if (ACPI_FAILURE(acpi_set_current_resources(handle, &buffer)))
ret = -EINVAL;
else if (acpi_bus_power_manageable(handle))
ret = acpi_bus_set_power(handle, ACPI_STATE_D0);
kfree(buffer.pointer);
return ret;
}

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

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

/* acpi_unregister_gsi(pnp_irq(dev, 0)); */
status = acpi_evaluate_object((acpi_handle) dev->data,
"_DIS", NULL, NULL);
return ACPI_FAILURE(status) ? -ENODEV : 0;
ret = 0;
if (acpi_bus_power_manageable(handle)) {
ret = acpi_bus_set_power(handle, ACPI_STATE_D3);
if (ret)
return ret;
}
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL)))
ret = -ENODEV;
return ret;
}

#ifdef CONFIG_ACPI_SLEEP
Expand Down

0 comments on commit 47ae106

Please sign in to comment.