[PATCH] bfin_twi: Remove useless twi_lock mutex

Previous thread: [PATCH v2] doc: about email clients for Linux patches by Randy Dunlap on Tuesday, September 11, 2007 - 11:42 pm. (1 message)

Next thread: [git pull] Input updates for 2.6.23-rc6 by Dmitry Torokhov on Wednesday, September 12, 2007 - 12:52 am. (1 message)
To: Francis Moreau <francis.moro@...>, Sonic Zhang <sonic.zhang@...>, Jean Delvare <khali@...>, <i2c@...>, Linux Kernel <linux-kernel@...>, Andrew Morton <akpm@...>
Date: Tuesday, September 11, 2007 - 11:48 pm

This patch removes this unneeded mutex. Indeed it was used
to serialized access to the hardware, but this is already
done by the i2c-core layer, see 'bus_lock' mutex used by
i2c_transfer().

Signed-off-by: Francis Moreau <francis.moro@gmail.com>
Acked-by: Bryan Wu <bryan.wu@analog.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
---
drivers/i2c/busses/i2c-bfin-twi.c | 16 ----------------
1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index 6311039..67224a4 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -44,7 +44,6 @@
#define TWI_I2C_MODE_COMBINED 0x04

struct bfin_twi_iface {
- struct mutex twi_lock;
int irq;
spinlock_t lock;
char read_write;
@@ -228,12 +227,8 @@ static int bfin_twi_master_xfer(struct i2c_adapter *adap,
if (!(bfin_read_TWI_CONTROL() & TWI_ENA))
return -ENXIO;

- mutex_lock(&iface->twi_lock);
-
while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) {
- mutex_unlock(&iface->twi_lock);
yield();
- mutex_lock(&iface->twi_lock);
}

ret = 0;
@@ -310,9 +305,6 @@ static int bfin_twi_master_xfer(struct i2c_adapter *adap,
break;
}

- /* Release mutex */
- mutex_unlock(&iface->twi_lock);
-
return ret;
}

@@ -330,12 +322,8 @@ int bfin_twi_smbus_xfer(struct i2c_adapter *adap, u16 addr,
if (!(bfin_read_TWI_CONTROL() & TWI_ENA))
return -ENXIO;

- mutex_lock(&iface->twi_lock);
-
while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) {
- mutex_unlock(&iface->twi_lock);
yield();
- mutex_lock(&iface->twi_lock);
}

iface->writeNum = 0;
@@ -502,9 +490,6 @@ int bfin_twi_smbus_xfer(struct i2c_adapter *adap, u16 addr,

rc = (iface->result >= 0) ? 0 : -1;

- /* Release mutex */
- mutex_unlock(&iface->twi_lock);
-
return rc;
}

@@ -555,7 +540,6 @@ static int i2c_bfin_t...

Previous thread: [PATCH v2] doc: about email clients for Linux patches by Randy Dunlap on Tuesday, September 11, 2007 - 11:42 pm. (1 message)

Next thread: [git pull] Input updates for 2.6.23-rc6 by Dmitry Torokhov on Wednesday, September 12, 2007 - 12:52 am. (1 message)