i2c-designware: i2c_dw_xfer_msg: Use "struct dw_i2c_dev" pointer
authorShinya Kuribayashi <shinya.kuribayashi@necel.com>
Fri, 6 Nov 2009 12:46:04 +0000 (21:46 +0900)
committerBen Dooks <ben-linux@fluff.org>
Wed, 9 Dec 2009 00:19:10 +0000 (00:19 +0000)
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>
drivers/i2c/busses/i2c-designware.c

index bb7b25766ea9c9263e8626f94561015887d7806b..443f398a21568cb80b4a9d36070e9d59831cf234 100644 (file)
@@ -254,9 +254,8 @@ static int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev)
  * that is longer than the size of the TX FIFO.
  */
 static void
-i2c_dw_xfer_msg(struct i2c_adapter *adap)
+i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
 {
-       struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
        struct i2c_msg *msgs = dev->msgs;
        int num = dev->msgs_num;
        u32 ic_con, intr_mask;
@@ -394,7 +393,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
                goto done;
 
        /* start the transfers */
-       i2c_dw_xfer_msg(adap);
+       i2c_dw_xfer_msg(dev);
 
        /* wait for tx to complete */
        ret = wait_for_completion_interruptible_timeout(&dev->cmd_complete, HZ);
@@ -450,7 +449,7 @@ static void dw_i2c_pump_msg(unsigned long data)
        u32 intr_mask;
 
        i2c_dw_read(dev);
-       i2c_dw_xfer_msg(&dev->adapter);
+       i2c_dw_xfer_msg(dev);
 
        intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT;
        if (dev->status & STATUS_WRITE_IN_PROGRESS)