Message ID | 1413570669-30738-1-git-send-email-festevam@gmail.com |
---|---|
State | Accepted |
Headers | show |
On Fri, Oct 17, 2014 at 03:31:08PM -0300, Fabio Estevam wrote: > From: Fabio Estevam <fabio.estevam@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@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 > thanks, please add my acks to both the patches. Acked-by: Huang Shijie <shijie8@gmail.com>
On Fri, Oct 17, 2014 at 03:31:08PM -0300, Fabio Estevam wrote: > From: Fabio Estevam <fabio.estevam@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@freescale.com> Applied to l2-mtd.git Brian
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);