diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-06-22 22:32:39 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-06-22 22:32:39 +0000 |
commit | 1263294a12e93f5bee2bcc89b64cf02da71de8af (patch) | |
tree | 99e128c2c1622443e9562f0b1e144996859633f8 | |
parent | 6d1d68acff5807e7fc4305be0d0ce9e459faa2f8 (diff) |
Allow powerdown() to be blindly called on machines with no power device.
-rw-r--r-- | sys/arch/sparc/dev/power.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/power.c b/sys/arch/sparc/dev/power.c index 02308765505..d796f382798 100644 --- a/sys/arch/sparc/dev/power.c +++ b/sys/arch/sparc/dev/power.c @@ -1,3 +1,4 @@ +/* $OpenBSD: power.c,v 1.2 1997/06/22 22:32:38 downsj Exp $ */ /* $NetBSD: power.c,v 1.2 1996/05/16 15:56:56 abrown Exp $ */ /* @@ -38,7 +39,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: power.c,v 1.1 1996/08/11 05:34:25 deraadt Exp $ */ #include <sys/param.h> @@ -61,6 +61,8 @@ struct cfdriver power_cd = { NULL, "power", DV_DULL }; +static char power_attached = 0; + /* * This is the driver for the "power" register available on some Sun4m * machines. This allows the machine to remove power automatically when @@ -93,11 +95,14 @@ powerattach(parent, self, aux) power_reg = mapdev(ra->ra_reg, 0, 0, sizeof(long), ca->ca_bustype); + power_attached = 1; + printf("\n"); } void powerdown() { - *POWER_REG |= POWER_OFF; + if (power_attached) + *POWER_REG |= POWER_OFF; } |