summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ppbus/lpt.c5
-rw-r--r--sys/dev/ppbus/ppb_base.c31
-rw-r--r--sys/dev/ppbus/ppb_msq.c5
-rw-r--r--sys/dev/ppbus/vpo.c5
4 files changed, 12 insertions, 34 deletions
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index 18d46ae..3a28efd2 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -447,10 +447,9 @@ lptout(void *arg)
{
struct lpt_data *sc = arg;
device_t dev = sc->sc_dev;
-#if defined(INVARIANTS) || defined(LPT_DEBUG)
- device_t ppbus = device_get_parent(dev);
-#endif
+ device_t ppbus;
+ ppbus = device_get_parent(dev);
ppb_assert_locked(ppbus);
lprintf(("T %x ", ppb_rstr(ppbus)));
if (sc->sc_state & OPEN) {
diff --git a/sys/dev/ppbus/ppb_base.c b/sys/dev/ppbus/ppb_base.c
index 62769b0..256d7a4 100644
--- a/sys/dev/ppbus/ppb_base.c
+++ b/sys/dev/ppbus/ppb_base.c
@@ -60,7 +60,7 @@ ppb_poll_bus(device_t bus, int max,
int i, j, error;
char r;
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
/* try at least up to 10ms */
for (j = 0; j < ((how & PPB_POLL) ? max : 1); j++) {
@@ -96,12 +96,9 @@ ppb_poll_bus(device_t bus, int max,
int
ppb_get_epp_protocol(device_t bus)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = DEVTOSOFTC(bus);
-#endif
uintptr_t protocol;
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
BUS_READ_IVAR(device_get_parent(bus), bus, PPC_IVAR_EPP_PROTO, &protocol);
return (protocol);
@@ -117,7 +114,7 @@ ppb_get_mode(device_t bus)
struct ppb_data *ppb = DEVTOSOFTC(bus);
/* XXX yet device mode = ppbus mode = chipset mode */
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
return (ppb->mode);
}
@@ -132,7 +129,7 @@ ppb_set_mode(device_t bus, int mode)
struct ppb_data *ppb = DEVTOSOFTC(bus);
int old_mode = ppb_get_mode(bus);
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
if (PPBUS_SETMODE(device_get_parent(bus), mode))
return (-1);
@@ -150,11 +147,8 @@ ppb_set_mode(device_t bus, int mode)
int
ppb_write(device_t bus, char *buf, int len, int how)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = DEVTOSOFTC(bus);
-#endif
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
return (PPBUS_WRITE(device_get_parent(bus), buf, len, how));
}
@@ -166,11 +160,8 @@ ppb_write(device_t bus, char *buf, int len, int how)
int
ppb_reset_epp_timeout(device_t bus)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = DEVTOSOFTC(bus);
-#endif
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
return(PPBUS_RESET_EPP(device_get_parent(bus)));
}
@@ -182,11 +173,8 @@ ppb_reset_epp_timeout(device_t bus)
int
ppb_ecp_sync(device_t bus)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = DEVTOSOFTC(bus);
-#endif
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
return (PPBUS_ECP_SYNC(device_get_parent(bus)));
}
@@ -198,12 +186,9 @@ ppb_ecp_sync(device_t bus)
int
ppb_get_status(device_t bus, struct ppb_status *status)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = DEVTOSOFTC(bus);
-#endif
register char r;
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
r = status->status = ppb_rstr(bus);
diff --git a/sys/dev/ppbus/ppb_msq.c b/sys/dev/ppbus/ppb_msq.c
index 6de67ce..8aba5ec 100644
--- a/sys/dev/ppbus/ppb_msq.c
+++ b/sys/dev/ppbus/ppb_msq.c
@@ -117,13 +117,10 @@ mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode)
int
ppb_MS_init(device_t bus, device_t dev, struct ppb_microseq *loop, int opcode)
{
-#ifdef INVARIANTS
- struct ppb_data *ppb = device_get_softc(bus);
-#endif
struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev);
struct ppb_xfer *xfer = mode2xfer(bus, ppbdev, opcode);
- mtx_assert(ppb->ppc_lock, MA_OWNED);
+ ppb_assert_locked(bus);
xfer->loop = loop;
return (0);
diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c
index 02bc9b3..9c9054f 100644
--- a/sys/dev/ppbus/vpo.c
+++ b/sys/dev/ppbus/vpo.c
@@ -298,11 +298,8 @@ static void
vpo_action(struct cam_sim *sim, union ccb *ccb)
{
struct vpo_data *vpo = (struct vpo_data *)sim->softc;
-#ifdef INVARIANTS
- device_t ppbus = device_get_parent(vpo->vpo_dev);
- ppb_assert_locked(ppbus);
-#endif
+ ppb_assert_locked(device_get_parent(vpo->vpo_dev));
switch (ccb->ccb_h.func_code) {
case XPT_SCSI_IO:
{
OpenPOWER on IntegriCloud