[PATCH 1/1] OMAP: McSPI: Unpaired clk_{en,dis}able calls.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux