diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-bfin-twi.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index dabfa80cf5f2..fb26e5c67515 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c | |||
@@ -159,18 +159,14 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface, | |||
159 | if (mast_stat & BUFWRERR) | 159 | if (mast_stat & BUFWRERR) |
160 | dev_dbg(&iface->adap.dev, "Buffer Write Error\n"); | 160 | dev_dbg(&iface->adap.dev, "Buffer Write Error\n"); |
161 | 161 | ||
162 | /* if both err and complete int stats are set, return proper | 162 | /* If it is a quick transfer, only address without data, |
163 | * results. | 163 | * not an err, return 1. |
164 | */ | 164 | */ |
165 | if (twi_int_status & MCOMP) { | 165 | if (iface->cur_mode == TWI_I2C_MODE_STANDARD && |
166 | /* If it is a quick transfer, only address without data, | 166 | iface->transPtr == NULL && |
167 | * not an err, return 1. | 167 | (twi_int_status & MCOMP) && (mast_stat & DNAK)) |
168 | * If address is acknowledged return 1. | 168 | iface->result = 1; |
169 | */ | 169 | |
170 | if ((iface->writeNum == 0 && (mast_stat & BUFRDERR)) | ||
171 | || !(mast_stat & ANAK)) | ||
172 | iface->result = 1; | ||
173 | } | ||
174 | complete(&iface->complete); | 170 | complete(&iface->complete); |
175 | return; | 171 | return; |
176 | } | 172 | } |