diff options
author | Felipe Balbi <balbi@ti.com> | 2012-09-12 06:57:56 -0400 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-09-12 09:01:52 -0400 |
commit | baf3d7b7210c705bf8ca7afb03cd7f0b61d27058 (patch) | |
tree | 066fb658ac9551785dffb5929e1ae19d4f77b57b | |
parent | d9ebd04d3476634c29ce0feffbc982e1cb25ed80 (diff) |
i2c: omap: simplify num_bytes handling
trivial patch, no functional changes
If the fifo is disabled or fifo_size is 0 the num_bytes
is set to 1. Else it is set to fifo_size or in case of a
draining interrupt the remaining bytes in the buff stat.
So the zero check is redundant and can be safely optimised.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by : Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 2d9b03c94614..236cb38bb859 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -812,8 +812,7 @@ complete: | |||
812 | OMAP_I2C_BUFSTAT_REG) | 812 | OMAP_I2C_BUFSTAT_REG) |
813 | >> 8) & 0x3F; | 813 | >> 8) & 0x3F; |
814 | } | 814 | } |
815 | while (num_bytes) { | 815 | while (num_bytes--) { |
816 | num_bytes--; | ||
817 | w = omap_i2c_read_reg(dev, OMAP_I2C_DATA_REG); | 816 | w = omap_i2c_read_reg(dev, OMAP_I2C_DATA_REG); |
818 | if (dev->buf_len) { | 817 | if (dev->buf_len) { |
819 | *dev->buf++ = w; | 818 | *dev->buf++ = w; |
@@ -855,8 +854,7 @@ complete: | |||
855 | OMAP_I2C_BUFSTAT_REG) | 854 | OMAP_I2C_BUFSTAT_REG) |
856 | & 0x3F; | 855 | & 0x3F; |
857 | } | 856 | } |
858 | while (num_bytes) { | 857 | while (num_bytes--) { |
859 | num_bytes--; | ||
860 | w = 0; | 858 | w = 0; |
861 | if (dev->buf_len) { | 859 | if (dev->buf_len) { |
862 | w = *dev->buf++; | 860 | w = *dev->buf++; |