aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-designware.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c
index 443f398a2156..fd1616b3d2b5 100644
--- a/drivers/i2c/busses/i2c-designware.c
+++ b/drivers/i2c/busses/i2c-designware.c
@@ -257,7 +257,6 @@ static void
257i2c_dw_xfer_msg(struct dw_i2c_dev *dev) 257i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
258{ 258{
259 struct i2c_msg *msgs = dev->msgs; 259 struct i2c_msg *msgs = dev->msgs;
260 int num = dev->msgs_num;
261 u32 ic_con, intr_mask; 260 u32 ic_con, intr_mask;
262 int tx_limit = dev->tx_fifo_depth - readl(dev->base + DW_IC_TXFLR); 261 int tx_limit = dev->tx_fifo_depth - readl(dev->base + DW_IC_TXFLR);
263 int rx_limit = dev->rx_fifo_depth - readl(dev->base + DW_IC_RXFLR); 262 int rx_limit = dev->rx_fifo_depth - readl(dev->base + DW_IC_RXFLR);
@@ -283,7 +282,7 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
283 writel(1, dev->base + DW_IC_ENABLE); 282 writel(1, dev->base + DW_IC_ENABLE);
284 } 283 }
285 284
286 for (; dev->msg_write_idx < num; dev->msg_write_idx++) { 285 for (; dev->msg_write_idx < dev->msgs_num; dev->msg_write_idx++) {
287 /* if target address has changed, we need to 286 /* if target address has changed, we need to
288 * reprogram the target address in the i2c 287 * reprogram the target address in the i2c
289 * adapter when we are done with this transfer 288 * adapter when we are done with this transfer
@@ -330,11 +329,10 @@ static void
330i2c_dw_read(struct dw_i2c_dev *dev) 329i2c_dw_read(struct dw_i2c_dev *dev)
331{ 330{
332 struct i2c_msg *msgs = dev->msgs; 331 struct i2c_msg *msgs = dev->msgs;
333 int num = dev->msgs_num;
334 u32 addr = msgs[dev->msg_read_idx].addr; 332 u32 addr = msgs[dev->msg_read_idx].addr;
335 int rx_valid = readl(dev->base + DW_IC_RXFLR); 333 int rx_valid = readl(dev->base + DW_IC_RXFLR);
336 334
337 for (; dev->msg_read_idx < num; dev->msg_read_idx++) { 335 for (; dev->msg_read_idx < dev->msgs_num; dev->msg_read_idx++) {
338 u32 len; 336 u32 len;
339 u8 *buf; 337 u8 *buf;
340 338