summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/wd.c10
-rw-r--r--sys/scsi/cd.c8
-rw-r--r--sys/scsi/sd.c8
3 files changed, 16 insertions, 10 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index 8d424fa49c8..d357e8fae2a 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.84 2010/06/07 20:32:45 jsg Exp $ */
+/* $OpenBSD: wd.c,v 1.85 2010/06/28 08:35:46 jsing Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -365,18 +365,20 @@ wdattach(struct device *parent, struct device *self, void *aux)
}
/*
- * Initialize and attach the disk structure.
+ * Initialize disk structures.
*/
wd->sc_dk.dk_driver = &wddkdriver;
wd->sc_dk.dk_name = wd->sc_dev.dv_xname;
wd->sc_bufq = bufq_init(BUFQ_DEFAULT);
- disk_attach(&wd->sc_dk);
- wd->sc_wdc_bio.lp = wd->sc_dk.dk_label;
wd->sc_sdhook = shutdownhook_establish(wd_shutdown, wd);
if (wd->sc_sdhook == NULL)
printf("%s: WARNING: unable to establish shutdown hook\n",
wd->sc_dev.dv_xname);
timeout_set(&wd->sc_restart_timeout, wdrestart, wd);
+
+ /* Attach disk. */
+ disk_attach(&wd->sc_dk);
+ wd->sc_wdc_bio.lp = wd->sc_dk.dk_label;
}
int
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index b721935f8b8..b62604ddc5a 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.171 2010/06/15 04:11:34 dlg Exp $ */
+/* $OpenBSD: cd.c,v 1.172 2010/06/28 08:35:46 jsing Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -221,12 +221,11 @@ cdattach(struct device *parent, struct device *self, void *aux)
sc_link->openings = CDOUTSTANDING;
/*
- * Initialize and attach the disk structure.
+ * Initialize disk structures.
*/
sc->sc_dk.dk_driver = &cddkdriver;
sc->sc_dk.dk_name = sc->sc_dev.dv_xname;
sc->sc_bufq = bufq_init(BUFQ_DEFAULT);
- disk_attach(&sc->sc_dk);
/*
* Note if this device is ancient. This is used in cdminphys().
@@ -244,6 +243,9 @@ cdattach(struct device *parent, struct device *self, void *aux)
if ((sc->sc_cdpwrhook = powerhook_establish(cd_powerhook, sc)) == NULL)
printf("%s: WARNING: unable to establish power hook\n",
sc->sc_dev.dv_xname);
+
+ /* Attach disk. */
+ disk_attach(&sc->sc_dk);
}
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 5ff51310ab3..11e207b3ff9 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.197 2010/06/24 10:05:18 dlg Exp $ */
+/* $OpenBSD: sd.c,v 1.198 2010/06/28 08:35:46 jsing Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -178,12 +178,11 @@ sdattach(struct device *parent, struct device *self, void *aux)
sc_link->device_softc = sc;
/*
- * Initialize and attach the disk structure.
+ * Initialize disk structures.
*/
sc->sc_dk.dk_driver = &sddkdriver;
sc->sc_dk.dk_name = sc->sc_dev.dv_xname;
sc->sc_bufq = bufq_init(BUFQ_DEFAULT);
- disk_attach(&sc->sc_dk);
if ((sc_link->flags & SDEV_ATAPI) && (sc_link->flags & SDEV_REMOVABLE))
sc_link->quirks |= SDEV_NOSYNCCACHE;
@@ -270,6 +269,9 @@ sdattach(struct device *parent, struct device *self, void *aux)
shutdownhook_establish(sd_shutdown, sc)) == NULL)
printf("%s: WARNING: unable to establish shutdown hook\n",
sc->sc_dev.dv_xname);
+
+ /* Attach disk. */
+ disk_attach(&sc->sc_dk);
}
int