aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-09-12 06:58:11 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-09-12 09:03:41 -0400
commitb07be0f3b9e1bed6cbd29117d7f0519d114fbd82 (patch)
treee764e956d03e759a4003ae3999ee85123aad4e51 /drivers/i2c/busses
parentdd74548ddece4b9d68e5528287a272fa552c81d0 (diff)
i2c: omap: get rid of the "complete" label
we can ack stat and complete the command from the errata handling itself. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-omap.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index f33bc5a55074..5d4bad44d370 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -775,6 +775,17 @@ static int errata_omap3_i462(struct omap_i2c_dev *dev)
775 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) { 775 if (stat & (OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) {
776 omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_XRDY | 776 omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_XRDY |
777 OMAP_I2C_STAT_XDR)); 777 OMAP_I2C_STAT_XDR));
778 if (stat & OMAP_I2C_STAT_NACK) {
779 dev->cmd_err |= OMAP_I2C_STAT_NACK;
780 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
781 }
782
783 if (stat & OMAP_I2C_STAT_AL) {
784 dev_err(dev->dev, "Arbitration lost\n");
785 dev->cmd_err |= OMAP_I2C_STAT_AL;
786 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
787 }
788
778 return -EIO; 789 return -EIO;
779 } 790 }
780 791
@@ -875,7 +886,6 @@ omap_i2c_isr(int this_irq, void *dev_id)
875 goto out; 886 goto out;
876 } 887 }
877 888
878complete:
879 if (stat & OMAP_I2C_STAT_NACK) { 889 if (stat & OMAP_I2C_STAT_NACK) {
880 err |= OMAP_I2C_STAT_NACK; 890 err |= OMAP_I2C_STAT_NACK;
881 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK); 891 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
@@ -938,7 +948,7 @@ complete:
938 ret = omap_i2c_transmit_data(dev, num_bytes, true); 948 ret = omap_i2c_transmit_data(dev, num_bytes, true);
939 stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); 949 stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
940 if (ret < 0) 950 if (ret < 0)
941 goto complete; 951 goto out;
942 952
943 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XDR); 953 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XDR);
944 continue; 954 continue;
@@ -954,7 +964,7 @@ complete:
954 ret = omap_i2c_transmit_data(dev, num_bytes, false); 964 ret = omap_i2c_transmit_data(dev, num_bytes, false);
955 stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); 965 stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
956 if (ret < 0) 966 if (ret < 0)
957 goto complete; 967 goto out;
958 968
959 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XRDY); 969 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XRDY);
960 continue; 970 continue;