From: Wei Yongjun Date: Sun, 2 Dec 2012 10:12:43 +0000 (-0500) Subject: serial: xilinx_uartps: fix return value check in xuartps_probe() X-Git-Tag: next-20130218~115^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a3607ea56f4455c515201ab91d2304a634925f6c;p=karo-tx-linux.git serial: xilinx_uartps: fix return value check in xuartps_probe() 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 Acked-by: Grant Likely --- diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 2be22a2a0ea1..1eb4657ab762 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -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);