mtd: fsl-quadspi: Let the clocks error path be clearer
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 17 Oct 2014 20:14:01 +0000 (17:14 -0300)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 22 Oct 2014 08:35:41 +0000 (01:35 -0700)
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>
drivers/mtd/spi-nor/fsl-quadspi.c

index 94e73553abb38cffd84105a0e29bc890e80b2a6d..b6aab38c4a975f57880937672e72011851f50fb6 100644 (file)
@@ -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 */
@@ -965,6 +964,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");