From: Pramod Gurav <pramod.gurav@smartplayin.com>
To: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
Subject: [PATCH] i2c: qup: disable clks and return instead of just returning error
Date: Wed, 6 Aug 2014 13:18:51 +0530 [thread overview]
Message-ID: <1407311331-15700-1-git-send-email-pramod.gurav@smartplayin.com> (raw)
This fixes a error handling scenario where clocks were not being disabled
when QUP_OUTPUT_BLOCK_SIZE returns a size greater thanat size of blk_sizes
array. So this patch adds a statement to jump to err lable to release the
clocks.
Wolfram Sang <wsa@the-dreams.de>
Grant Likely <grant.likely@linaro.org>
Bjorn Andersson <bjorn.andersson@sonymobile.com>
Andy Gross <agross@codeaurora.org>
"Ivan T. Ivanov" <iivanov@mm-sol.com>
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---
drivers/i2c/busses/i2c-qup.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 2a5efb5..3a4d64e 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)
* associated with each byte written/received
*/
size = QUP_OUTPUT_BLOCK_SIZE(io_mode);
- if (size >= ARRAY_SIZE(blk_sizes))
- return -EIO;
+ if (size >= ARRAY_SIZE(blk_sizes)) {
+ ret = -EIO;
+ goto fail;
+ }
qup->out_blk_sz = blk_sizes[size] / 2;
size = QUP_INPUT_BLOCK_SIZE(io_mode);
- if (size >= ARRAY_SIZE(blk_sizes))
- return -EIO;
+ if (size >= ARRAY_SIZE(blk_sizes)) {
+ ret = -EIO;
+ goto fail;
+ }
qup->in_blk_sz = blk_sizes[size] / 2;
size = QUP_OUTPUT_FIFO_SIZE(io_mode);
--
1.7.9.5
next reply other threads:[~2014-08-06 7:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 7:48 Pramod Gurav [this message]
2014-08-06 7:53 [PATCH] i2c: qup: disable clks and return instead of just returning error Pramod Gurav
[not found] ` <1407311602-15751-1-git-send-email-pramod.gurav-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
2014-08-06 11:21 ` Ivan T. Ivanov
2014-08-06 11:21 ` Ivan T. Ivanov
2014-08-06 12:19 ` Christopher Covington
2014-08-06 12:33 Pramod Gurav
2014-08-06 12:33 ` Pramod Gurav
2014-08-09 19:32 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407311331-15700-1-git-send-email-pramod.gurav@smartplayin.com \
--to=pramod.gurav@smartplayin.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.