summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAllen Xu <b45815@freescale.com>2014-12-04 01:06:47 +0800
committerAllen Xu <b45815@freescale.com>2014-12-04 01:44:50 +0800
commitbd6fde3b824264037fce9f5c1d53ca7ef93a7722 (patch)
tree69e217451c7e6aa76c49272458f2ea83d069edd6 /drivers
parent9d1ba3997f656e962ff73e00bb7bd61c6c2b3afe (diff)
MLK-9949: mtd: qspi: Handle QSPI probe error path correctly
If QSPI probe failed in some cases, such as board rework, the error patch was not handled correctly. This issue may cause kernle dump in fec driver, since the pm_qos_remove_request() in QSPI driver was not invoked when probe failed. Signed-off-by: Allen Xu <b45815@freescale.com> (cherry picked from commit 350d532e0266a0a6918cbc6a17952ef64aef2521)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/spi-nor/fsl-quadspi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index c1ad93c75a21..3f6018d6833f 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -1052,11 +1052,13 @@ 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;
id = spi_nor_match_id(modalias);
- if (!id)
- goto map_failed;
+ if (!id) {
+ ret = -EINVAL;
+ goto irq_failed;
+ }
/* get the NOR chip manufacture id */
jedec_mfr_id = (*(u32 *)(id->driver_data)) >> 16;
@@ -1066,19 +1068,19 @@ static int fsl_qspi_probe(struct platform_device *pdev)
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, id, 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) {