aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2014-02-13 15:36:32 -0500
committerWolfram Sang <wsa@the-dreams.de>2014-03-10 12:23:20 -0400
commitb0200abeba3134002819c92dfef5e16c8e92f7e2 (patch)
tree90113e86138869df9f2466aabd6943a413153be5
parent4c5b38e881b1a91ea5816162341275670fd655ca (diff)
i2c: mv64xxx: directly call send_start when initializing transfer
Calling the state machine with a definite state which is only used in this context is superfluous. Do it directly. Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 98de78fd27eb..6cb5d2f93d59 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -98,7 +98,6 @@ enum {
98enum { 98enum {
99 MV64XXX_I2C_ACTION_INVALID, 99 MV64XXX_I2C_ACTION_INVALID,
100 MV64XXX_I2C_ACTION_CONTINUE, 100 MV64XXX_I2C_ACTION_CONTINUE,
101 MV64XXX_I2C_ACTION_SEND_START,
102 MV64XXX_I2C_ACTION_SEND_RESTART, 101 MV64XXX_I2C_ACTION_SEND_RESTART,
103 MV64XXX_I2C_ACTION_OFFLOAD_RESTART, 102 MV64XXX_I2C_ACTION_OFFLOAD_RESTART,
104 MV64XXX_I2C_ACTION_SEND_ADDR_1, 103 MV64XXX_I2C_ACTION_SEND_ADDR_1,
@@ -467,10 +466,6 @@ mv64xxx_i2c_do_action(struct mv64xxx_i2c_data *drv_data)
467 drv_data->reg_base + drv_data->reg_offsets.control); 466 drv_data->reg_base + drv_data->reg_offsets.control);
468 break; 467 break;
469 468
470 case MV64XXX_I2C_ACTION_SEND_START:
471 mv64xxx_i2c_send_start(drv_data);
472 break;
473
474 case MV64XXX_I2C_ACTION_SEND_ADDR_1: 469 case MV64XXX_I2C_ACTION_SEND_ADDR_1:
475 writel(drv_data->addr1, 470 writel(drv_data->addr1,
476 drv_data->reg_base + drv_data->reg_offsets.data); 471 drv_data->reg_base + drv_data->reg_offsets.data);
@@ -633,12 +628,11 @@ mv64xxx_i2c_execute_msg(struct mv64xxx_i2c_data *drv_data, struct i2c_msg *msg,
633 628
634 spin_lock_irqsave(&drv_data->lock, flags); 629 spin_lock_irqsave(&drv_data->lock, flags);
635 630
636 drv_data->action = MV64XXX_I2C_ACTION_SEND_START;
637 drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND; 631 drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND;
638 632
639 drv_data->send_stop = is_last; 633 drv_data->send_stop = is_last;
640 drv_data->block = 1; 634 drv_data->block = 1;
641 mv64xxx_i2c_do_action(drv_data); 635 mv64xxx_i2c_send_start(drv_data);
642 spin_unlock_irqrestore(&drv_data->lock, flags); 636 spin_unlock_irqrestore(&drv_data->lock, flags);
643 637
644 mv64xxx_i2c_wait_for_completion(drv_data); 638 mv64xxx_i2c_wait_for_completion(drv_data);