[PATCH 2/2] mtd: fsl-quadspi: Provide an error code on spi_nor_match_id() failure

Brian Norris computersforpeace at gmail.com
Wed Oct 22 01:52:12 PDT 2014


On Fri, Oct 17, 2014 at 03:31:09PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam at freescale.com>
> 
> If spi_nor_match_id fails then we need to propagate an error code into 'ret',
> otherwise the probe function will succeed.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
> ---
>  drivers/mtd/spi-nor/fsl-quadspi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
> index c5d10c3..4a2799f 100644
> --- a/drivers/mtd/spi-nor/fsl-quadspi.c
> +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
> @@ -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.

>  
>  		ret = of_property_read_u32(np, "spi-max-frequency",
>  				&q->clk_rate);

Regards,
Brian



More information about the linux-mtd mailing list