mtd: fsl-quadspi: Fix the error paths

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Feb 16 18:59:05 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e4ca6840837be86b89e77c8402c1e6ab8a36f274
Commit:     e4ca6840837be86b89e77c8402c1e6ab8a36f274
Parent:     0760e818646d801a13eed57f5fb75c43c7c2794a
Author:     Fabio Estevam <fabio.estevam at freescale.com>
AuthorDate: Thu Jan 22 22:43:05 2015 -0200
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Feb 5 19:51:27 2015 -0800

    mtd: fsl-quadspi: Fix the error paths
    
    Jumping to 'map_failed' label is not correct at these points, as it misses to
    disable the clocks that were previously enabled.
    
    Jump to 'irq_failed' label instead that will correctly disable the clocks.
    
    Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
    Acked-by: Han Xu <han.xu at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/spi-nor/fsl-quadspi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index a46bea3..a733bd2 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -890,24 +890,24 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 
 		ret = of_modalias_node(np, modalias, sizeof(modalias));
 		if (ret < 0)
-			goto map_failed;
+			goto irq_failed;
 
 		ret = of_property_read_u32(np, "spi-max-frequency",
 				&q->clk_rate);
 		if (ret < 0)
-			goto map_failed;
+			goto irq_failed;
 
 		/* set the chip address for READID */
 		fsl_qspi_set_base_addr(q, nor);
 
 		ret = spi_nor_scan(nor, modalias, SPI_NOR_QUAD);
 		if (ret)
-			goto map_failed;
+			goto irq_failed;
 
 		ppdata.of_node = np;
 		ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
 		if (ret)
-			goto map_failed;
+			goto irq_failed;
 
 		/* Set the correct NOR size now. */
 		if (q->nor_size == 0) {



More information about the linux-mtd-cvs mailing list