Module Name:    src
Committed By:   rmind
Date:           Wed Jun  8 22:43:10 UTC 2011

Modified Files:
        src/sys/arch/i386/pci: viapcib.c

Log Message:
Convert simple_lock to mutex.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/pci/viapcib.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/arch/i386/pci/viapcib.c
diff -u src/sys/arch/i386/pci/viapcib.c:1.12 src/sys/arch/i386/pci/viapcib.c:1.13
--- src/sys/arch/i386/pci/viapcib.c:1.12	Fri Oct  2 21:27:45 2009
+++ src/sys/arch/i386/pci/viapcib.c	Wed Jun  8 22:43:10 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $ */
+/* $NetBSD: viapcib.c,v 1.13 2011/06/08 22:43:10 rmind Exp $ */
 /* $FreeBSD: src/sys/pci/viapm.c,v 1.10 2005/05/29 04:42:29 nyan Exp $ */
 
 /*-
@@ -55,14 +55,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.12 2009/10/02 21:27:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viapcib.c,v 1.13 2011/06/08 22:43:10 rmind Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/proc.h>
-#include <sys/simplelock.h>
+#include <sys/mutex.h>
 #include <sys/bus.h>
 
 #include <dev/pci/pcireg.h>
@@ -92,7 +91,7 @@
 
 	int sc_revision;
 
-	struct simplelock sc_lock;
+	kmutex_t sc_lock;
 };
 
 static int	viapcib_match(device_t, cfdata_t, void *);
@@ -172,7 +171,7 @@
 		goto core_pcib;
 	}
 
-	simple_lock_init(&sc->sc_lock);
+	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	val = pci_conf_read(pa->pa_pc, pa->pa_tag, SMB_HOST_CONFIG);
 	if ((val & 0x10000) == 0) {
@@ -281,13 +280,10 @@
 static int
 viapcib_acquire_bus(void *opaque, int flags)
 {
-	struct viapcib_softc *sc;
+	struct viapcib_softc *sc = (struct viapcib_softc *)opaque;
 
 	DPRINTF(("viapcib_i2c_acquire_bus(%p, 0x%x)\n", opaque, flags));
-
-	sc = (struct viapcib_softc *)opaque;
-
-	simple_lock(&sc->sc_lock);
+	mutex_enter(&sc->sc_lock);
 
 	return 0;
 }
@@ -295,15 +291,10 @@
 static void
 viapcib_release_bus(void *opaque, int flags)
 {
-	struct viapcib_softc *sc;
+	struct viapcib_softc *sc = (struct viapcib_softc *)opaque;
 
+	mutex_exit(&sc->sc_lock);
 	DPRINTF(("viapcib_i2c_release_bus(%p, 0x%x)\n", opaque, flags));
-
-	sc = (struct viapcib_softc *)opaque;
-
-	simple_unlock(&sc->sc_lock);
-
-	return;
 }
 
 static int

Reply via email to