aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Lawson <njl@FreeBSD.org>2004-04-14 17:46:21 +0000
committerNate Lawson <njl@FreeBSD.org>2004-04-14 17:46:21 +0000
commit916dc0e20c9ffde35dcb42706183a4e1330dd57f (patch)
treed4d345fab575910675ed684d328384629db99bdb
parent95ee3674194626d77dffec9b7363258c3a2b1b57 (diff)
Notes
-rw-r--r--sys/dev/acpica/acpi_pci.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c
index aa95d228d7f27..736086d8fff20 100644
--- a/sys/dev/acpica/acpi_pci.c
+++ b/sys/dev/acpica/acpi_pci.c
@@ -162,6 +162,7 @@ acpi_pci_child_location_str_method(device_t cbdev, device_t child, char *buf,
static int
acpi_pci_set_powerstate_method(device_t dev, device_t child, int state)
{
+ ACPI_HANDLE h;
ACPI_STATUS status;
int acpi_state, old_state, error;
@@ -197,12 +198,15 @@ acpi_pci_set_powerstate_method(device_t dev, device_t child, int state)
if (error)
return (error);
}
- status = acpi_pwr_switch_consumer(acpi_get_handle(child), acpi_state);
- if (ACPI_FAILURE(status))
- device_printf(dev,
- "Failed to set ACPI power state D%d on %s: %s\n",
- acpi_state, device_get_nameunit(child),
- AcpiFormatException(status));
+ h = acpi_get_handle(child);
+ if (h != NULL) {
+ status = acpi_pwr_switch_consumer(h, acpi_state);
+ if (ACPI_FAILURE(status))
+ device_printf(dev,
+ "Failed to set ACPI power state D%d on %s: %s\n",
+ acpi_state, device_get_nameunit(child),
+ AcpiFormatException(status));
+ }
if (state > old_state)
return (pci_set_powerstate_method(dev, child, state));
else