aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorPramod Gurav <pramod.gurav@smartplayin.com>2014-08-06 08:33:25 -0400
committerWolfram Sang <wsa@the-dreams.de>2014-08-06 14:50:44 -0400
commit3cf357dfb40b4a594a704f05b629cb5db97cc7fb (patch)
tree222683da36b8fc8e69441b76b27fa9722f59683c /drivers/i2c
parent741d3589e2213be4343529f57904521c6b846b10 (diff)
i2c: qup: disable clks and return instead of just returning error
This fixes a error handling scenario where clocks were not being disabled when QUP_OUTPUT_BLOCK_SIZE returns a size greater than the size of blk_sizes array. So this patch adds a statement to jump to the fail lable to release the clocks. Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-qup.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 2a5efb5b487c..3a4d64e1dfb1 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -633,13 +633,17 @@ static int qup_i2c_probe(struct platform_device *pdev)
633 * associated with each byte written/received 633 * associated with each byte written/received
634 */ 634 */
635 size = QUP_OUTPUT_BLOCK_SIZE(io_mode); 635 size = QUP_OUTPUT_BLOCK_SIZE(io_mode);
636 if (size >= ARRAY_SIZE(blk_sizes)) 636 if (size >= ARRAY_SIZE(blk_sizes)) {
637 return -EIO; 637 ret = -EIO;
638 goto fail;
639 }
638 qup->out_blk_sz = blk_sizes[size] / 2; 640 qup->out_blk_sz = blk_sizes[size] / 2;
639 641
640 size = QUP_INPUT_BLOCK_SIZE(io_mode); 642 size = QUP_INPUT_BLOCK_SIZE(io_mode);
641 if (size >= ARRAY_SIZE(blk_sizes)) 643 if (size >= ARRAY_SIZE(blk_sizes)) {
642 return -EIO; 644 ret = -EIO;
645 goto fail;
646 }
643 qup->in_blk_sz = blk_sizes[size] / 2; 647 qup->in_blk_sz = blk_sizes[size] / 2;
644 648
645 size = QUP_OUTPUT_FIFO_SIZE(io_mode); 649 size = QUP_OUTPUT_FIFO_SIZE(io_mode);