summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_autoconf.c12
-rw-r--r--sys/kern/subr_hibernate.c6
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 63909888184..390dee9ca8b 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.73 2013/12/12 20:56:01 guenther Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.74 2014/03/13 03:52:56 dlg Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -859,6 +859,16 @@ device_lookup(struct cfdriver *cd, int unit)
return (dv);
}
+struct device *
+device_mainbus(void)
+{
+ extern struct cfdriver mainbus_cd;
+
+ if (mainbus_cd.cd_ndevs < 1)
+ return (NULL);
+
+ return (mainbus_cd.cd_devs[0]);
+}
/*
* Increments the ref count on the device structure. The device
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index 147a3e1803b..4d0efd949c6 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.84 2014/02/01 07:10:33 mlarkin Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.85 2014/03/13 03:52:56 dlg Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -1152,14 +1152,14 @@ hibernate_resume(void)
if (hibernate_read_image(&disk_hib))
goto fail;
- if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_QUIESCE) != 0)
+ if (config_suspend(device_mainbus(), DVACT_QUIESCE) != 0)
goto fail;
(void) splhigh();
hibernate_disable_intr_machdep();
cold = 1;
- if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND) != 0) {
+ if (config_suspend(device_mainbus(), DVACT_SUSPEND) != 0) {
cold = 0;
hibernate_enable_intr_machdep();
goto fail;