spi/fsl: deal with a compile warning
authorZhao Qiang <B45475@freescale.com>
Thu, 26 Jun 2014 03:26:43 +0000 (11:26 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 2 Jul 2014 19:50:17 +0000 (20:50 +0100)
ret is unused when CONFIG_FSL_SOC defined,
so return ret instead of -ENOMEM when the
kzalloc fails to avoid it.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-fsl-lib.c

index 95212ea96c8dc07dff0599730e3e525368873a27..e0b773fc29cb08af12f25d07d6e0e3bda36b7148 100644 (file)
@@ -196,7 +196,7 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
 
        pinfo = devm_kzalloc(&ofdev->dev, sizeof(*pinfo), GFP_KERNEL);
        if (!pinfo)
-               return -ENOMEM;
+               return ret;
 
        pdata = &pinfo->pdata;
        dev->platform_data = pdata;