mtd: fsl-quadspi: Propagate the error from of_modalias_node()
Subsystems (2)
PATCH 1/2 mtd: fsl-quadspi: Propagate the error from of_modalias_node()
From: Fabio Estevam <[email protected]>
The 'map_failed' label will return 'ret', so we need to assign the error code to 'ret', otherwise the probe function will return success.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/fsl-quadspi.c +2 -1
@@ -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);
Signature · 1 line
1.9.1
PATCH 2/2 mtd: fsl-quadspi: Provide an error code on spi_nor_match_id() failure
From: Fabio Estevam <[email protected]>
If spi_nor_match_id fails then we need to propagate an error code into 'ret', otherwise the probe function will succeed.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/fsl-quadspi.c +3 -1
@@ -911,8 +911,10 @@ static int fsl_qspi_probe(struct platform_device *pdev) goto map_failed; id =spi_nor_match_id (modalias); -if (!id) +if (!id) { + ret = -EINVAL ; goto map_failed; + } ret =of_property_read_u32 (np,"spi-max-frequency" , &q->clk_rate);
Signature · 1 line
1.9.1
Re: [PATCH 2/2] mtd: fsl-quadspi: Provide an error code on spi_nor_match_id() failure
Quoted 15 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
If
spi_nor_match_idfails then we need to propagate an error code into 'ret', otherwise the probe function will succeed.Signed-off-by Fabio Estevam <[email protected]>--- drivers/mtd/spi-nor/fsl-quadspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/mtd/spi-nor/fsl-quadspi.c +0
-0
drivers/mtd/spi-nor/fsl-quadspi.c static int fsl_qspi_probe(struct platform_device *pdev) · line 917
Quoted 8 lines
drivers/mtd/spi-nor/fsl-quadspi.c +3
-1@@ -911,8 +911,10 @@ static int fsl_qspi_probe(struct platform_device *pdev) goto map_failed; id =spi_nor_match_id (modalias); -if (!id) +if (!id) { + ret = -EINVAL ; goto map_failed; + }
The call to spi_nor_match_id() was dropped, so this patch is not necessary any more.
drivers/mtd/spi-nor/fsl-quadspi.c static int fsl_qspi_probe(struct platform_device *pdev) · line 920
Quoted 3 lines
drivers/mtd/spi-nor/fsl-quadspi.c +0
-0ret =of_property_read_u32 (np,"spi-max-frequency" , &q->clk_rate);
Regards,
Brian
Quoted 27 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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 <[email protected]>--- drivers/mtd/spi-nor/fsl-quadspi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mtd/spi-nor/fsl-quadspi.c +2
-1@@ -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);Signature · 1 line
1.9.1
thanks, please add my acks to both the patches.
Brian Norris
AppliedQuoted 6 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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 <[email protected]>
Applied to l2-mtd.git
Brian