All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	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>
Subject: [PATCH] i2c: qup: disable clks and return instead of just returning error
Date: Wed,  6 Aug 2014 13:23:22 +0530	[thread overview]
Message-ID: <1407311602-15751-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.

CC: Wolfram Sang <wsa@the-dreams.de>
CC: Grant Likely <grant.likely@linaro.org>
CC: Bjorn Andersson <bjorn.andersson@sonymobile.com>
CC: Andy Gross <agross@codeaurora.org>
CC: "Ivan T. Ivanov" <iivanov@mm-sol.com>

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---

Resending the patch by updating CCs list.
 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

             reply	other threads:[~2014-08-06  7:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06  7:53 Pramod Gurav [this message]
     [not found] ` <1407311602-15751-1-git-send-email-pramod.gurav-edOiRQu9Xnj5XLMNweQjbQ@public.gmane.org>
2014-08-06 11:21   ` [PATCH] i2c: qup: disable clks and return instead of just returning error Ivan T. Ivanov
2014-08-06 11:21     ` Ivan T. Ivanov
2014-08-06 12:19 ` Christopher Covington
  -- strict thread matches above, loose matches on Subject: below --
2014-08-06 12:33 Pramod Gurav
2014-08-06 12:33 ` Pramod Gurav
2014-08-09 19:32 ` Wolfram Sang
2014-08-06  7:48 Pramod Gurav

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=1407311602-15751-1-git-send-email-pramod.gurav@smartplayin.com \
    --to=pramod.gurav@smartplayin.com \
    --cc=agross@codeaurora.org \
    --cc=bjorn.andersson@sonymobile.com \
    --cc=grant.likely@linaro.org \
    --cc=iivanov@mm-sol.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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.