]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Use the correct device. Note this commit complements r274386.
authorjkim <jkim@FreeBSD.org>
Tue, 11 Nov 2014 19:42:10 +0000 (19:42 +0000)
committerjkim <jkim@FreeBSD.org>
Tue, 11 Nov 2014 19:42:10 +0000 (19:42 +0000)
PR: 194884

sys/dev/acpica/acpi.c

index e7389af50db7c929b1a5a07fe5ca54f37ffef390..0e8998b0949622389fb6045db1b27bf538bc44de 100644 (file)
@@ -694,7 +694,7 @@ acpi_attach(device_t dev)
 static void
 acpi_set_power_children(device_t dev, int state)
 {
-       device_t child, parent;
+       device_t child;
        device_t *devlist;
        int dstate, i, numdevs;
 
@@ -705,12 +705,11 @@ acpi_set_power_children(device_t dev, int state)
         * Retrieve and set D-state for the sleep state if _SxD is present.
         * Skip children who aren't attached since they are handled separately.
         */
-       parent = device_get_parent(dev);
        for (i = 0; i < numdevs; i++) {
                child = devlist[i];
                dstate = state;
                if (device_is_attached(child) &&
-                   acpi_device_pwr_for_sleep(parent, child, &dstate) == 0)
+                   acpi_device_pwr_for_sleep(dev, child, &dstate) == 0)
                        acpi_set_powerstate(child, dstate);
        }
        free(devlist, M_TEMP);