All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Carmody <ext-phil.2.carmody@nokia.com>
To: linux-omap@vger.kernel.org
Cc: Phil Carmody <ext-phil.2.carmody@nokia.com>
Subject: [PATCH 1/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls.
Date: Thu, 19 Feb 2009 17:24:02 +0200	[thread overview]
Message-ID: <e1ddb08341604496c13766d174bfe055662cc917.1235046721.git.ext-phil.2.carmody@nokia.com> (raw)
In-Reply-To: <1235057042-6833-1-git-send-email-ext-phil.2.carmody@nokia.com>

If the sky is always blue, and no functions fail, then the interface
and functional clocks will always be in the same state. However,
defensively, failure to enable the 2nd should re-disable the 1st.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
---
 drivers/spi/omap2_mcspi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 3da8825..bdccb27 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -277,9 +277,10 @@ static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi)
 {
 	if (clk_enable(mcspi->ick))
 		return -ENODEV;
-	if (clk_enable(mcspi->fck))
+	if (clk_enable(mcspi->fck)) {
+		clk_disable(mcspi->ick);
 		return -ENODEV;
-
+	}
 	omap2_mcspi_restore_ctx(mcspi);
 
 	return 0;
-- 
1.5.4.3


  reply	other threads:[~2009-02-19 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 15:24 [PATCH 0/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls Phil Carmody
2009-02-19 15:24 ` Phil Carmody [this message]
2009-02-27 18:28   ` [PATCH 1/1] " Tony Lindgren

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=e1ddb08341604496c13766d174bfe055662cc917.1235046721.git.ext-phil.2.carmody@nokia.com \
    --to=ext-phil.2.carmody@nokia.com \
    --cc=linux-omap@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.