diff options
author | Yuan Yao <yao.yuan@nxp.com> | 2017-01-13 07:49:53 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-09-25 07:25:31 (GMT) |
commit | f9418e99109c36247c768419ed28c14d0edc1477 (patch) | |
tree | 771026a90497a075ab5ad8f944c68a10294b0e3e /drivers/mtd | |
parent | 9ca93d4dbd605c66feded08145916619864313ec (diff) | |
download | linux-f9418e99109c36247c768419ed28c14d0edc1477.tar.xz |
mtd: spi-nor: fsl-quad: allow sub node probe failed
The QSPI can support max to four spi flash at the same time.
But sometime one or more flash maybe probe failed because of the
wrong setting or the hardware issue or some othere.
But as long as there is one flash probe success, that the QSPI driver
should probe success and finish all the initialization.
Signed-off-by: Yuan Yao <yao.yuan@nxp.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/spi-nor/fsl-quadspi.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c index 6e1168b..5a5b355 100644 --- a/drivers/mtd/spi-nor/fsl-quadspi.c +++ b/drivers/mtd/spi-nor/fsl-quadspi.c @@ -1161,6 +1161,7 @@ static int fsl_qspi_probe(struct platform_device *pdev) struct spi_nor *nor; struct mtd_info *mtd; int ret, i = 0; + int find_node; enum read_mode mode = SPI_NOR_QUAD; q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL); @@ -1238,6 +1239,7 @@ static int fsl_qspi_probe(struct platform_device *pdev) mutex_init(&q->lock); + find_node = 0; /* iterate the subnodes. */ for_each_available_child_of_node(dev->of_node, np) { /* skip the holes */ @@ -1264,7 +1266,7 @@ 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 mutex_failed; + continue; /* set the chip address for READID */ fsl_qspi_set_base_addr(q, nor); @@ -1278,11 +1280,11 @@ static int fsl_qspi_probe(struct platform_device *pdev) ret = spi_nor_scan(nor, NULL, mode); if (ret) - goto mutex_failed; + continue; ret = mtd_device_register(mtd, NULL, 0); if (ret) - goto mutex_failed; + continue; /* Set the correct NOR size now. */ if (q->nor_size == 0) { @@ -1305,8 +1307,12 @@ static int fsl_qspi_probe(struct platform_device *pdev) nor->page_size = q->devtype_data->txfifo; i++; + find_node++; } + if (find_node == 0) + goto mutex_failed; + /* finish the rest init. */ ret = fsl_qspi_nor_setup_last(q); if (ret) |