diff options
-rw-r--r-- | 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 6311039dfe60..67224a424aba 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #define TWI_I2C_MODE_COMBINED 0x04 | 44 | #define TWI_I2C_MODE_COMBINED 0x04 |
45 | 45 | ||
46 | struct bfin_twi_iface { | 46 | struct bfin_twi_iface { |
47 | struct mutex twi_lock; | ||
48 | int irq; | 47 | int irq; |
49 | spinlock_t lock; | 48 | spinlock_t lock; |
50 | char read_write; | 49 | char read_write; |
@@ -228,12 +227,8 @@ static int bfin_twi_master_xfer(struct i2c_adapter *adap, | |||
228 | if (!(bfin_read_TWI_CONTROL() & TWI_ENA)) | 227 | if (!(bfin_read_TWI_CONTROL() & TWI_ENA)) |
229 | return -ENXIO; | 228 | return -ENXIO; |
230 | 229 | ||
231 | mutex_lock(&iface->twi_lock); | ||
232 | |||
233 | while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) { | 230 | while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) { |
234 | mutex_unlock(&iface->twi_lock); | ||
235 | yield(); | 231 | yield(); |
236 | mutex_lock(&iface->twi_lock); | ||
237 | } | 232 | } |
238 | 233 | ||
239 | ret = 0; | 234 | ret = 0; |
@@ -310,9 +305,6 @@ static int bfin_twi_master_xfer(struct i2c_adapter *adap, | |||
310 | break; | 305 | break; |
311 | } | 306 | } |
312 | 307 | ||
313 | /* Release mutex */ | ||
314 | mutex_unlock(&iface->twi_lock); | ||
315 | |||
316 | return ret; | 308 | return ret; |
317 | } | 309 | } |
318 | 310 | ||
@@ -330,12 +322,8 @@ int bfin_twi_smbus_xfer(struct i2c_adapter *adap, u16 addr, | |||
330 | if (!(bfin_read_TWI_CONTROL() & TWI_ENA)) | 322 | if (!(bfin_read_TWI_CONTROL() & TWI_ENA)) |
331 | return -ENXIO; | 323 | return -ENXIO; |
332 | 324 | ||
333 | mutex_lock(&iface->twi_lock); | ||
334 | |||
335 | while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) { | 325 | while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) { |
336 | mutex_unlock(&iface->twi_lock); | ||
337 | yield(); | 326 | yield(); |
338 | mutex_lock(&iface->twi_lock); | ||
339 | } | 327 | } |
340 | 328 | ||
341 | iface->writeNum = 0; | 329 | iface->writeNum = 0; |
@@ -502,9 +490,6 @@ int bfin_twi_smbus_xfer(struct i2c_adapter *adap, u16 addr, | |||
502 | 490 | ||
503 | rc = (iface->result >= 0) ? 0 : -1; | 491 | rc = (iface->result >= 0) ? 0 : -1; |
504 | 492 | ||
505 | /* Release mutex */ | ||
506 | mutex_unlock(&iface->twi_lock); | ||
507 | |||
508 | return rc; | 493 | return rc; |
509 | } | 494 | } |
510 | 495 | ||
@@ -555,7 +540,6 @@ static int i2c_bfin_twi_probe(struct platform_device *dev) | |||
555 | struct i2c_adapter *p_adap; | 540 | struct i2c_adapter *p_adap; |
556 | int rc; | 541 | int rc; |
557 | 542 | ||
558 | mutex_init(&(iface->twi_lock)); | ||
559 | spin_lock_init(&(iface->lock)); | 543 | spin_lock_init(&(iface->lock)); |
560 | init_completion(&(iface->complete)); | 544 | init_completion(&(iface->complete)); |
561 | iface->irq = IRQ_TWI; | 545 | iface->irq = IRQ_TWI; |