From 5d0cbf63df54f4d9e00ee623c47f598d54ed279a Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Fri, 27 Mar 2009 16:02:42 +0000 Subject: convert iopiic lockmgr to rwlock. ok drahn@, sthen@ tested. --- sys/arch/arm/xscale/i80321_i2c.c | 6 +++--- sys/arch/arm/xscale/iopi2c.c | 8 ++++---- sys/arch/arm/xscale/iopi2cvar.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'sys/arch/arm') diff --git a/sys/arch/arm/xscale/i80321_i2c.c b/sys/arch/arm/xscale/i80321_i2c.c index ffa3eff6a18..4b3121dcfd0 100644 --- a/sys/arch/arm/xscale/i80321_i2c.c +++ b/sys/arch/arm/xscale/i80321_i2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i80321_i2c.c,v 1.2 2006/07/10 15:39:56 drahn Exp $ */ +/* $OpenBSD: i80321_i2c.c,v 1.3 2009/03/27 16:02:41 oga Exp $ */ /* $NetBSD: i80321_i2c.c,v 1.2 2005/12/11 12:16:51 christos Exp $ */ /* @@ -41,7 +41,7 @@ */ #include -#include +#include #include #include #include @@ -110,7 +110,7 @@ i80321_i2c_attach(struct device *parent, struct device *self, void *aux) /* XXX Reset the I2C unit? */ - lockinit(&sc->sc_buslock, PRIBIO|PCATCH, "iopiiclk", 0, 0); + rw_init(&sc->sc_buslock, "iopiiclk"); /* XXX We don't currently use interrupts. Fix this some day. */ #if 0 diff --git a/sys/arch/arm/xscale/iopi2c.c b/sys/arch/arm/xscale/iopi2c.c index 58cc3094aa3..7d5c01aabf6 100644 --- a/sys/arch/arm/xscale/iopi2c.c +++ b/sys/arch/arm/xscale/iopi2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iopi2c.c,v 1.2 2006/07/10 15:39:56 drahn Exp $ */ +/* $OpenBSD: iopi2c.c,v 1.3 2009/03/27 16:02:41 oga Exp $ */ /* $NetBSD: iopi2c.c,v 1.3 2005/12/11 12:16:51 christos Exp $ */ /* @@ -40,7 +40,7 @@ * Intel i80321 I/O Processor I2C Controller Unit support. */ #include -#include +#include #include #include #include @@ -96,7 +96,7 @@ iopiic_acquire_bus(void *cookie, int flags) if (flags & I2C_F_POLL) return (0); - return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL)); + return (rw_enter(&sc->sc_buslock, RW_WRITE | RW_INTR)); } static void @@ -108,7 +108,7 @@ iopiic_release_bus(void *cookie, int flags) if (flags & I2C_F_POLL) return; - (void) lockmgr(&sc->sc_buslock, LK_RELEASE, NULL); + rw_exit(&sc->sc_buslock); } #define IOPIIC_TIMEOUT 100 /* protocol timeout, in uSecs */ diff --git a/sys/arch/arm/xscale/iopi2cvar.h b/sys/arch/arm/xscale/iopi2cvar.h index 9d38bab837b..e8a3e3965ef 100644 --- a/sys/arch/arm/xscale/iopi2cvar.h +++ b/sys/arch/arm/xscale/iopi2cvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: iopi2cvar.h,v 1.2 2006/07/10 15:39:56 drahn Exp $ */ +/* $OpenBSD: iopi2cvar.h,v 1.3 2009/03/27 16:02:41 oga Exp $ */ /* $NetBSD: iopi2cvar.h,v 1.2 2005/12/11 12:16:51 christos Exp $ */ /* @@ -47,7 +47,7 @@ struct iopiic_softc { void *sc_ih; struct i2c_controller sc_i2c; - struct lock sc_buslock; + struct rwlock sc_buslock; uint32_t sc_icr; }; -- cgit v1.2.3