public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer
@ 2014-10-17 20:14 Fabio Estevam
  2014-10-19  2:31 ` Huang Shijie
  2014-10-22  8:54 ` Brian Norris
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2014-10-17 20:14 UTC (permalink / raw)
  To: computersforpeace; +Cc: Fabio Estevam, b32955, linux-mtd

From: Fabio Estevam <fabio.estevam@freescale.com>

When clk_prepare_enable(q->clk) fails it is clearer to disable the previous
acquired clock (q->clk_en) in the error path rather than doing it locally.

So disable q->clk_en in the error path only.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/spi-nor/fsl-quadspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index e1c517d..8006f26 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -843,9 +843,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 
 	ret = clk_prepare_enable(q->clk);
 	if (ret) {
-		clk_disable_unprepare(q->clk_en);
 		dev_err(dev, "can not enable the qspi clock\n");
-		goto map_failed;
+		goto clk_failed;
 	}
 
 	/* find the irq */
@@ -966,6 +965,7 @@ last_init_failed:
 
 irq_failed:
 	clk_disable_unprepare(q->clk);
+clk_failed:
 	clk_disable_unprepare(q->clk_en);
 map_failed:
 	dev_err(dev, "Freescale QuadSPI probe failed\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer
  2014-10-17 20:14 [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer Fabio Estevam
@ 2014-10-19  2:31 ` Huang Shijie
  2014-10-22  8:54 ` Brian Norris
  1 sibling, 0 replies; 3+ messages in thread
From: Huang Shijie @ 2014-10-19  2:31 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, b32955, computersforpeace, linux-mtd

On Fri, Oct 17, 2014 at 05:14:01PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> When clk_prepare_enable(q->clk) fails it is clearer to disable the previous
> acquired clock (q->clk_en) in the error path rather than doing it locally.
> 
> So disable q->clk_en in the error path only.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mtd/spi-nor/fsl-quadspi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
> index e1c517d..8006f26 100644
> --- a/drivers/mtd/spi-nor/fsl-quadspi.c
> +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
> @@ -843,9 +843,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
>  
>  	ret = clk_prepare_enable(q->clk);
>  	if (ret) {
> -		clk_disable_unprepare(q->clk_en);
>  		dev_err(dev, "can not enable the qspi clock\n");
> -		goto map_failed;
> +		goto clk_failed;
>  	}
>  
>  	/* find the irq */
> @@ -966,6 +965,7 @@ last_init_failed:
>  
>  irq_failed:
>  	clk_disable_unprepare(q->clk);
> +clk_failed:
>  	clk_disable_unprepare(q->clk_en);
>  map_failed:
>  	dev_err(dev, "Freescale QuadSPI probe failed\n");
> -- 
> 1.9.1
Acked-by: Huang Shijie <shijie8@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer
  2014-10-17 20:14 [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer Fabio Estevam
  2014-10-19  2:31 ` Huang Shijie
@ 2014-10-22  8:54 ` Brian Norris
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2014-10-22  8:54 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, b32955, linux-mtd

On Fri, Oct 17, 2014 at 05:14:01PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> When clk_prepare_enable(q->clk) fails it is clearer to disable the previous
> acquired clock (q->clk_en) in the error path rather than doing it locally.
> 
> So disable q->clk_en in the error path only.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Pushed to l2-mtd.git.

Brian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-22  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 20:14 [PATCH] mtd : fsl-quadspi: Let the clocks error path be clearer Fabio Estevam
2014-10-19  2:31 ` Huang Shijie
2014-10-22  8:54 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox