ARM: pxa: fix return value check in pxa2xx_drv_pcmcia_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 21 Sep 2012 07:19:09 +0000 (15:19 +0800)
committerHaojian Zhuang <haojian.zhuang@gmail.com>
Fri, 21 Sep 2012 07:33:58 +0000 (15:33 +0800)
In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL pointer. The NULL test in the error
handling should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
drivers/pcmcia/pxa2xx_base.c

index 490bb82b5bdbd0be8394590f0c7c65b85088f238..cfec9dd18ff5463813d3238aeba9873f164b4703 100644 (file)
@@ -297,7 +297,7 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
        }
 
        clk = clk_get(&dev->dev, NULL);
-       if (!clk)
+       if (IS_ERR(clk))
                return -ENODEV;
 
        pxa2xx_drv_pcmcia_ops(ops);