[PATCH 1/2] mtd: fsl-quadspi: Propagate the error from of_modalias_node()
Fabio Estevam
festevam at gmail.com
Fri Oct 17 11:31:08 PDT 2014
From: Fabio Estevam <fabio.estevam at freescale.com>
The 'map_failed' label will return 'ret', so we need to assign the error
code to 'ret', otherwise the probe function will return success.
Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
drivers/mtd/spi-nor/fsl-quadspi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 8d659a2..c5d10c3 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -906,7 +906,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
nor->prepare = fsl_qspi_prep;
nor->unprepare = fsl_qspi_unprep;
- if (of_modalias_node(np, modalias, sizeof(modalias)) < 0)
+ ret = of_modalias_node(np, modalias, sizeof(modalias));
+ if (ret < 0)
goto map_failed;
id = spi_nor_match_id(modalias);
--
1.9.1
More information about the linux-mtd
mailing list