Commit 78839bd0 authored by Shinya Kuribayashi's avatar Shinya Kuribayashi Committed by Ben Dooks

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: default avatarShinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 91b52cae
...@@ -328,9 +328,8 @@ i2c_dw_xfer_msg(struct i2c_adapter *adap) ...@@ -328,9 +328,8 @@ i2c_dw_xfer_msg(struct i2c_adapter *adap)
} }
static void static void
i2c_dw_read(struct i2c_adapter *adap) i2c_dw_read(struct dw_i2c_dev *dev)
{ {
struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
struct i2c_msg *msgs = dev->msgs; struct i2c_msg *msgs = dev->msgs;
int num = dev->msgs_num; int num = dev->msgs_num;
u32 addr = msgs[dev->msg_read_idx].addr; 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,7 +415,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
if (likely(!dev->cmd_err)) { if (likely(!dev->cmd_err)) {
/* read rx fifo, and disable the adapter */ /* read rx fifo, and disable the adapter */
do { do {
i2c_dw_read(adap); i2c_dw_read(dev);
} while (dev->status & STATUS_READ_IN_PROGRESS); } while (dev->status & STATUS_READ_IN_PROGRESS);
writel(0, dev->base + DW_IC_ENABLE); writel(0, dev->base + DW_IC_ENABLE);
ret = num; ret = num;
...@@ -450,7 +449,7 @@ static void dw_i2c_pump_msg(unsigned long data) ...@@ -450,7 +449,7 @@ static void dw_i2c_pump_msg(unsigned long data)
struct dw_i2c_dev *dev = (struct dw_i2c_dev *) data; struct dw_i2c_dev *dev = (struct dw_i2c_dev *) data;
u32 intr_mask; u32 intr_mask;
i2c_dw_read(&dev->adapter); i2c_dw_read(dev);
i2c_dw_xfer_msg(&dev->adapter); i2c_dw_xfer_msg(&dev->adapter);
intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT; intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment