Module Name:    src
Committed By:   jruoho
Date:           Sun Jan  9 15:43:21 UTC 2011

Modified Files:
        src/sys/dev/acpi: acpi_fan.c

Log Message:
After consulting jmcneill@, set the state to D0 ("on") upon shutdown and
detach. A safety measure so that we do not accidentally fry anything.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/acpi_fan.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi_fan.c
diff -u src/sys/dev/acpi/acpi_fan.c:1.1 src/sys/dev/acpi/acpi_fan.c:1.2
--- src/sys/dev/acpi/acpi_fan.c:1.1	Sun Jan  9 15:12:34 2011
+++ src/sys/dev/acpi/acpi_fan.c	Sun Jan  9 15:43:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_fan.c,v 1.1 2011/01/09 15:12:34 jruoho Exp $ */
+/*	$NetBSD: acpi_fan.c,v 1.2 2011/01/09 15:43:20 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 Jukka Ruohonen <jruoho...@iki.fi>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_fan.c,v 1.1 2011/01/09 15:12:34 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_fan.c,v 1.2 2011/01/09 15:43:20 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/module.h>
@@ -112,6 +112,9 @@
 {
 	struct acpifan_softc *sc = device_private(self);
 
+	if (sc->sc_state != ACPI_STATE_ERROR)
+		(void)acpi_power_set(sc->sc_node->ad_handle, ACPI_STATE_D0);
+
 	pmf_device_deregister(self);
 	acpi_power_deregister(sc->sc_node->ad_handle);
 
@@ -152,7 +155,7 @@
 	struct acpifan_softc *sc = device_private(self);
 
 	if (sc->sc_state != ACPI_STATE_ERROR)
-		(void)acpi_power_set(sc->sc_node->ad_handle, ACPI_STATE_D3);
+		(void)acpi_power_set(sc->sc_node->ad_handle, ACPI_STATE_D0);
 
 	return true;
 }

Reply via email to