summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2013-05-01 00:47:31 +0000
committerdlg <dlg@openbsd.org>2013-05-01 00:47:31 +0000
commit2ab43ed2e8d50089fbf0e754e34834e93be99ef9 (patch)
tree3b2e10a9a1a804a8d5349dae6deca14c38523b8c
parentAdd a cortex bus which represents the ARM MPCore Complex. (diff)
downloadwireguard-openbsd-2ab43ed2e8d50089fbf0e754e34834e93be99ef9.tar.xz
wireguard-openbsd-2ab43ed2e8d50089fbf0e754e34834e93be99ef9.zip
dont need to walk alldevs during sensor creation looking for the logical
disk scsibus when we record that in mfi_attach. also happens to get rid of a logic error that let it come out of the loop on alldevs with a reference to something that wasnt the logical disk scsibus and use that.
-rw-r--r--sys/dev/ic/mfi.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 66fc4c5fecf..15744960a5e 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.140 2013/04/30 07:17:36 dlg Exp $ */
+/* $OpenBSD: mfi.c,v 1.141 2013/05/01 00:47:31 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -2024,23 +2024,9 @@ int
mfi_create_sensors(struct mfi_softc *sc)
{
struct device *dev;
- struct scsibus_softc *ssc = NULL;
struct scsi_link *link;
int i;
- TAILQ_FOREACH(dev, &alldevs, dv_list) {
- if (dev->dv_parent != &sc->sc_dev)
- continue;
-
- /* check if this is the scsibus for the logical disks */
- ssc = (struct scsibus_softc *)dev;
- if (ssc->adapter_link == &sc->sc_link)
- break;
- }
-
- if (ssc == NULL)
- return (1);
-
sc->sc_sensors = malloc(sizeof(struct ksensor) * sc->sc_ld_cnt,
M_DEVBUF, M_NOWAIT | M_ZERO);
if (sc->sc_sensors == NULL)
@@ -2050,7 +2036,7 @@ mfi_create_sensors(struct mfi_softc *sc)
sizeof(sc->sc_sensordev.xname));
for (i = 0; i < sc->sc_ld_cnt; i++) {
- link = scsi_get_link(ssc, i, 0);
+ link = scsi_get_link(sc->sc_scsibus, i, 0);
if (link == NULL)
goto bad;