]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial: xilinx_uartps: fix return value check in xuartps_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 2 Dec 2012 10:12:43 +0000 (05:12 -0500)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 21 Dec 2012 15:24:09 +0000 (16:24 +0100)
In case of error, function of_clk_get() returns ERR_PTR()
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
drivers/tty/serial/xilinx_uartps.c

index 2be22a2a0ea10e82fc9c4c8587af3c7dc1651728..1eb4657ab762f926cf40c5759780d270945915a4 100644 (file)
@@ -948,9 +948,9 @@ static int xuartps_probe(struct platform_device *pdev)
        struct clk *clk;
 
        clk = of_clk_get(pdev->dev.of_node, 0);
-       if (!clk) {
+       if (IS_ERR(clk)) {
                dev_err(&pdev->dev, "no clock specified\n");
-               return -ENODEV;
+               return PTR_ERR(clk);
        }
 
        rc = clk_prepare_enable(clk);