aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-omap.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-09-12 06:58:09 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-09-12 09:03:26 -0400
commit4a7ec4eda58269a507501f240955d99312fdfd5f (patch)
tree2233875f52ae819e32b6d4b44aaf0d218d0e8f7b /drivers/i2c/busses/i2c-omap.c
parent6a85ced2cf299b916c04499b2c3d7b353cc2101f (diff)
i2c: omap: simplify IRQ exit path
instead of having multiple return points, use a goto statement to make that clearer. 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/i2c-omap.c')
-rw-r--r--drivers/i2c/busses/i2c-omap.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 96fd528e888a..4af123fab63c 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -853,24 +853,21 @@ omap_i2c_isr(int this_irq, void *dev_id)
853 dev_dbg(dev->dev, "IRQ (ISR = 0x%04x)\n", stat); 853 dev_dbg(dev->dev, "IRQ (ISR = 0x%04x)\n", stat);
854 if (count++ == 100) { 854 if (count++ == 100) {
855 dev_warn(dev->dev, "Too much work in one IRQ\n"); 855 dev_warn(dev->dev, "Too much work in one IRQ\n");
856 omap_i2c_complete_cmd(dev, err); 856 goto out;
857 return IRQ_HANDLED;
858 } 857 }
859 858
860complete: 859complete:
861 if (stat & OMAP_I2C_STAT_NACK) { 860 if (stat & OMAP_I2C_STAT_NACK) {
862 err |= OMAP_I2C_STAT_NACK; 861 err |= OMAP_I2C_STAT_NACK;
863 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK); 862 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
864 omap_i2c_complete_cmd(dev, err); 863 goto out;
865 return IRQ_HANDLED;
866 } 864 }
867 865
868 if (stat & OMAP_I2C_STAT_AL) { 866 if (stat & OMAP_I2C_STAT_AL) {
869 dev_err(dev->dev, "Arbitration lost\n"); 867 dev_err(dev->dev, "Arbitration lost\n");
870 err |= OMAP_I2C_STAT_AL; 868 err |= OMAP_I2C_STAT_AL;
871 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_AL); 869 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_AL);
872 omap_i2c_complete_cmd(dev, err); 870 goto out;
873 return IRQ_HANDLED;
874 } 871 }
875 872
876 /* 873 /*
@@ -883,8 +880,7 @@ complete:
883 OMAP_I2C_STAT_XRDY | 880 OMAP_I2C_STAT_XRDY |
884 OMAP_I2C_STAT_XDR | 881 OMAP_I2C_STAT_XDR |
885 OMAP_I2C_STAT_ARDY)); 882 OMAP_I2C_STAT_ARDY));
886 omap_i2c_complete_cmd(dev, err); 883 goto out;
887 return IRQ_HANDLED;
888 } 884 }
889 885
890 if (stat & OMAP_I2C_STAT_RDR) { 886 if (stat & OMAP_I2C_STAT_RDR) {
@@ -949,19 +945,19 @@ complete:
949 dev_err(dev->dev, "Receive overrun\n"); 945 dev_err(dev->dev, "Receive overrun\n");
950 err |= OMAP_I2C_STAT_ROVR; 946 err |= OMAP_I2C_STAT_ROVR;
951 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ROVR); 947 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ROVR);
952 omap_i2c_complete_cmd(dev, err); 948 goto out;
953 return IRQ_HANDLED;
954 } 949 }
955 950
956 if (stat & OMAP_I2C_STAT_XUDF) { 951 if (stat & OMAP_I2C_STAT_XUDF) {
957 dev_err(dev->dev, "Transmit underflow\n"); 952 dev_err(dev->dev, "Transmit underflow\n");
958 err |= OMAP_I2C_STAT_XUDF; 953 err |= OMAP_I2C_STAT_XUDF;
959 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XUDF); 954 omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XUDF);
960 omap_i2c_complete_cmd(dev, err); 955 goto out;
961 return IRQ_HANDLED;
962 } 956 }
963 } while (stat); 957 } while (stat);
964 958
959out:
960 omap_i2c_complete_cmd(dev, err);
965 return IRQ_HANDLED; 961 return IRQ_HANDLED;
966} 962}
967 963