diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-01 03:20:40 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2010-07-01 03:20:40 +0000 |
commit | b2735ac78382db6f10e2c1a21582733693b825bb (patch) | |
tree | b8011a9cdd5222b156fe4b36da8358ebf62b031f /sys/dev/ic/cac.c | |
parent | 241672bb6dfbe3c1c24caad5b6dc595bb19ffd59 (diff) |
Change scsibus(4)'s scsi_link array to an SLIST to save memory on
sparsely populated buses.
ok dlg@, krw@
Diffstat (limited to 'sys/dev/ic/cac.c')
-rw-r--r-- | sys/dev/ic/cac.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 090cfb4f10a..b6ab9a51917 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.39 2010/06/28 18:31:02 krw Exp $ */ +/* $OpenBSD: cac.c,v 1.40 2010/07/01 03:20:38 matthew Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -886,6 +886,7 @@ cac_create_sensors(struct cac_softc *sc) { struct device *dev; struct scsibus_softc *ssc = NULL; + struct scsi_link *link; int i; TAILQ_FOREACH(dev, &alldevs, dv_list) { @@ -911,10 +912,11 @@ cac_create_sensors(struct cac_softc *sc) sizeof(sc->sc_sensordev.xname)); for (i = 0; i < sc->sc_nunits; i++) { - if (ssc->sc_link[i][0] == NULL) + link = scsi_get_link(ssc, i, 0); + if (link == NULL) goto bad; - dev = ssc->sc_link[i][0]->device_softc; + dev = link->device_softc; sc->sc_sensors[i].type = SENSOR_DRIVE; sc->sc_sensors[i].status = SENSOR_S_UNKNOWN; |