Skip to content

Commit

Permalink
mtd: fsl-quadspi: Let the clocks error path be clearer
Browse files Browse the repository at this point in the history
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>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Fabio Estevam authored and Brian Norris committed Oct 22, 2014
1 parent b26171e commit 77adc08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/spi-nor/fsl-quadspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,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 */
Expand Down Expand Up @@ -965,6 +964,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)

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");
Expand Down

0 comments on commit 77adc08

Please sign in to comment.