summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/scsi/cd.c10
-rw-r--r--sys/scsi/st.c18
2 files changed, 16 insertions, 12 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 42ce3a0bd9d..89693528e69 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.242 2020/01/26 00:53:31 krw Exp $ */
+/* $OpenBSD: cd.c,v 1.243 2020/01/27 07:41:02 krw Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -668,12 +668,14 @@ retry:
void
cdminphys(struct buf *bp)
{
+ struct scsi_link *link;
struct cd_softc *sc;
long max;
sc = cdlookup(DISKUNIT(bp->b_dev));
if (sc == NULL)
return;
+ link = sc->sc_link;
/*
* If the device is ancient, we want to make sure that
@@ -693,9 +695,9 @@ cdminphys(struct buf *bp)
bp->b_bcount = max;
}
- (*sc->sc_link->adapter->dev_minphys)(bp, sc->sc_link);
- if (sc->sc_link->adapter->dev_minphys != scsi_minphys)
- scsi_minphys(bp, sc->sc_link);
+ (*link->adapter->dev_minphys)(bp, link);
+ if (link->adapter->dev_minphys != scsi_minphys)
+ scsi_minphys(bp, link);
device_unref(&sc->sc_dev);
}
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 804fda26b20..027a31fb262 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.174 2020/01/26 00:53:31 krw Exp $ */
+/* $OpenBSD: st.c,v 1.175 2020/01/27 07:41:02 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -1000,17 +1000,19 @@ st_buf_done(struct scsi_xfer *xs)
void
stminphys(struct buf *bp)
{
- struct st_softc *st;
+ struct scsi_link *link;
+ struct st_softc *sc;
- st = stlookup(STUNIT(bp->b_dev));
- if (st == NULL)
+ sc = stlookup(STUNIT(bp->b_dev));
+ if (sc == NULL)
return;
+ link = sc->sc_link;
- (*st->sc_link->adapter->dev_minphys)(bp, st->sc_link);
- if (st->sc_link->adapter->dev_minphys != scsi_minphys)
- scsi_minphys(bp, st->sc_link);
+ (*link->adapter->dev_minphys)(bp, link);
+ if (link->adapter->dev_minphys != scsi_minphys)
+ scsi_minphys(bp, link);
- device_unref(&st->sc_dev);
+ device_unref(&sc->sc_dev);
}
int