diff options
author | Shinya Kuribayashi <shinya.kuribayashi@necel.com> | 2009-11-06 07:45:39 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-12-08 19:19:10 -0500 |
commit | 78839bd0f22c3b6e7273568e042bf4d637cfedb3 (patch) | |
tree | 496b7e33c1b6926ea84dcd2b0d15e6df269fbbaa /drivers/i2c/busses/i2c-designware.c | |
parent | 91b52caec040064b4df540b72ad7f18a22fd0508 (diff) |
i2c-designware: i2c_dw_read: Use "struct dw_i2c_dev" pointer
We don't have to use "struct i2c_adapter" pointer here.
Let's use a local "struct dw_i2c_dev" pointer, instead.
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c index 139f5556b610..bb7b25766ea9 100644 --- a/drivers/i2c/busses/i2c-designware.c +++ b/drivers/i2c/busses/i2c-designware.c | |||
@@ -328,9 +328,8 @@ i2c_dw_xfer_msg(struct i2c_adapter *adap) | |||
328 | } | 328 | } |
329 | 329 | ||
330 | static void | 330 | static void |
331 | i2c_dw_read(struct i2c_adapter *adap) | 331 | i2c_dw_read(struct dw_i2c_dev *dev) |
332 | { | 332 | { |
333 | struct dw_i2c_dev *dev = i2c_get_adapdata(adap); | ||
334 | struct i2c_msg *msgs = dev->msgs; | 333 | struct i2c_msg *msgs = dev->msgs; |
335 | int num = dev->msgs_num; | 334 | int num = dev->msgs_num; |
336 | u32 addr = msgs[dev->msg_read_idx].addr; | 335 | u32 addr = msgs[dev->msg_read_idx].addr; |
@@ -416,7 +415,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | |||
416 | if (likely(!dev->cmd_err)) { | 415 | if (likely(!dev->cmd_err)) { |
417 | /* read rx fifo, and disable the adapter */ | 416 | /* read rx fifo, and disable the adapter */ |
418 | do { | 417 | do { |
419 | i2c_dw_read(adap); | 418 | i2c_dw_read(dev); |
420 | } while (dev->status & STATUS_READ_IN_PROGRESS); | 419 | } while (dev->status & STATUS_READ_IN_PROGRESS); |
421 | writel(0, dev->base + DW_IC_ENABLE); | 420 | writel(0, dev->base + DW_IC_ENABLE); |
422 | ret = num; | 421 | ret = num; |
@@ -450,7 +449,7 @@ static void dw_i2c_pump_msg(unsigned long data) | |||
450 | struct dw_i2c_dev *dev = (struct dw_i2c_dev *) data; | 449 | struct dw_i2c_dev *dev = (struct dw_i2c_dev *) data; |
451 | u32 intr_mask; | 450 | u32 intr_mask; |
452 | 451 | ||
453 | i2c_dw_read(&dev->adapter); | 452 | i2c_dw_read(dev); |
454 | i2c_dw_xfer_msg(&dev->adapter); | 453 | i2c_dw_xfer_msg(&dev->adapter); |
455 | 454 | ||
456 | intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT; | 455 | intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT; |