Module Name:    src
Committed By:   thorpej
Date:           Sun Sep 26 14:56:36 UTC 2021

Modified Files:
        src/sys/dev/pci: oboe.c

Log Message:
- Use seltrue_filtops rather than rolling our own with filt_seltrue.
- Remove sc_wsel completely; nothing actually uses it.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/oboe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/oboe.c
diff -u src/sys/dev/pci/oboe.c:1.50 src/sys/dev/pci/oboe.c:1.51
--- src/sys/dev/pci/oboe.c:1.50	Sun Sep 26 01:16:09 2021
+++ src/sys/dev/pci/oboe.c	Sun Sep 26 14:56:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: oboe.c,v 1.50 2021/09/26 01:16:09 thorpej Exp $	*/
+/*	$NetBSD: oboe.c,v 1.51 2021/09/26 14:56:36 thorpej Exp $	*/
 
 /*	XXXXFVDL THIS DRIVER IS BROKEN FOR NON-i386 -- vtophys() usage	*/
 
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.50 2021/09/26 01:16:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.51 2021/09/26 14:56:36 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -96,7 +96,6 @@ struct oboe_softc {
 	bus_space_handle_t	sc_ioh;
 	bus_dma_tag_t		sc_dmatag;
 	struct selinfo		sc_rsel;
-	struct selinfo		sc_wsel;
 
 	int			sc_state;
 #define	OBOE_RSLP		0x01	/* waiting for data (read) */
@@ -227,7 +226,6 @@ oboe_attach(device_t parent, device_t se
 	aprint_normal_dev(self, "interrupting at %s\n", intrstring);
 
 	selinit(&sc->sc_rsel);
-	selinit(&sc->sc_wsel);
 
 	sc->sc_txs = 0;
 	sc->sc_rxs = 0;
@@ -252,7 +250,6 @@ oboe_detach(device_t self, int flags)
 	DPRINTF(("%s: sc=%p\n", __func__, sc));
 #endif
 	seldestroy(&sc->sc_rsel);
-	seldestroy(&sc->sc_wsel);
 	return (0);
 }
 
@@ -483,17 +480,6 @@ filt_oboeread(struct knote *kn, long hin
 	return (kn->kn_data > 0);
 }
 
-static void
-filt_oboewdetach(struct knote *kn)
-{
-	struct oboe_softc *sc = kn->kn_hook;
-	int s;
-
-	s = splir();
-	selremove_knote(&sc->sc_wsel, kn);
-	splx(s);
-}
-
 static const struct filterops oboeread_filtops = {
 	.f_flags = FILTEROP_ISFD,
 	.f_attach = NULL,
@@ -501,39 +487,28 @@ static const struct filterops oboeread_f
 	.f_event = filt_oboeread,
 };
 
-static const struct filterops oboewrite_filtops = {
-	.f_flags = FILTEROP_ISFD,
-	.f_attach = NULL,
-	.f_detach = filt_oboewdetach,
-	.f_event = filt_seltrue,
-};
-
 static int
 oboe_kqfilter(void *h, struct knote *kn)
 {
 	struct oboe_softc *sc = h;
-	struct selinfo *sip;
 	int s;
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		sip = &sc->sc_rsel;
 		kn->kn_fop = &oboeread_filtops;
+		kn->kn_hook = sc;
+		s = splir();
+		selrecord_knote(&sc->sc_rsel, kn);
+		splx(s);
 		break;
+
 	case EVFILT_WRITE:
-		sip = &sc->sc_wsel;
-		kn->kn_fop = &oboewrite_filtops;
+		kn->kn_fop = &seltrue_filtops;
 		break;
 	default:
 		return (EINVAL);
 	}
 
-	kn->kn_hook = sc;
-
-	s = splir();
-	selrecord_knote(sip, kn);
-	splx(s);
-
 	return (0);
 }
 
@@ -613,7 +588,6 @@ oboe_intr(void *p)
 			DPRINTF(("oboe_intr: waking up writer\n"));
 			wakeup(&sc->sc_txs);
 		}
-		selnotify(&sc->sc_wsel, 0, 0);
 	}
 	return (1);
 }

Reply via email to