From d7b8f1775805d1153cc44f7891137ac007b0bb94 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Wed, 1 May 2013 00:47:32 +0000 Subject: 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. --- sys/dev/ic/mfi.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'sys/dev/ic/mfi.c') 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 * @@ -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; -- cgit v1.2.3