diff mbox

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

Message ID e1ddb08341604496c13766d174bfe055662cc917.1235046721.git.ext-phil.2.carmody@nokia.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

Phil Carmody Feb. 19, 2009, 3:24 p.m. UTC
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(-)

Comments

Tony Lindgren Feb. 27, 2009, 6:28 p.m. UTC | #1
* Phil Carmody <ext-phil.2.carmody@nokia.com> [090219 07:26]:
> 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.

This too should be sent for mainline integration. See "SPI SUBSYSTEM"
in the MAINTAINERS file.

Regards,

Tony
 
> 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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;