From 88cdb16876ecc8a50de1d699e2faedb34b757c3a Mon Sep 17 00:00:00 2001 From: kn Date: Sun, 30 Oct 2022 10:55:52 +0000 Subject: [PATCH] Move duplex check from sbdsp_midi_open() to sbdsp_open() where it belongs sbdsp.c r1.42 "Replace audio(9) get_props() with duplex check in open() in partial duplex drivers" added it to the wrong function. --- sys/dev/isa/sbdsp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index a785a6e2c47..23b213c8e57 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbdsp.c,v 1.42 2022/10/28 14:55:46 kn Exp $ */ +/* $OpenBSD: sbdsp.c,v 1.43 2022/10/30 10:55:52 kn Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -761,6 +761,9 @@ sbdsp_open(void *addr, int flags) DPRINTF(("sbdsp_open: sc=%p\n", sc)); + if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD) && + !sc->sc_fullduplex) + return ENXIO; if (sc->sc_open != SB_CLOSED) return EBUSY; if (sbdsp_reset(sc) != 0) @@ -2126,9 +2129,6 @@ sbdsp_midi_open(void *addr, int flags, void (*iintr)(void *, int), DPRINTF(("sbdsp_midi_open: sc=%p\n", sc)); - if ((flags & (FWRITE | FREAD)) == (FWRITE | FREAD) && - !sc->sc_fullduplex) - return ENXIO; if (sc->sc_open != SB_CLOSED) return EBUSY; if (sbdsp_reset(sc) != 0) -- 2.20.1