Subject: Bug in brooktree driver?
To: None <tech-kern@netbsd.org>
From: Martin J. Laubach <mjl@emsi.priv.at>
List: tech-kern
Date: 03/01/2001 23:19:40
  While browsing one of the "other" BSD sites, I found the
following patch that kind of makes sense. Can someone with a
deeper understanding of drivers give a yea or nay?

	mjl


Index: bktr_os.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/bktr/bktr_os.c,v
retrieving revision 1.17
diff -u -1 -5 -r1.17 bktr_os.c
--- bktr_os.c	2000/12/30 17:02:53	1.17
+++ bktr_os.c	2001/03/01 23:14:20
@@ -748,31 +748,31 @@
 int
 bktr_mmap( dev_t dev, vm_offset_t offset, int nprot )
 {
 	int		unit;
 	bktr_ptr_t	bktr;
 
 	unit = UNIT(minor(dev));
 
 	if (FUNCTION(minor(dev)) > 0)	/* only allow mmap on /dev/bktr[n] */
 		return( -1 );
 
 	/* Get the device data */
 	bktr = (struct bktr_softc*)devclass_get_softc(bktr_devclass, unit);
 	if (bktr == NULL) {
 		/* the device is no longer valid/functioning */
-		return (ENXIO);
+		return (-1);
 	}
 
 	if (nprot & PROT_EXEC)
 		return( -1 );