net/irda: sh_sir: fix return value check in sh_sir_set_baudrate()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 20 Sep 2012 21:13:55 +0000 (21:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Sep 2012 17:47:24 +0000 (13:47 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/irda/sh_sir.c

index 256eddf1f75a1913576067742f8fc1cb3dce3e7a..795109425568623977428b1a62bffc7d11c6fa14 100644 (file)
@@ -280,7 +280,7 @@ static int sh_sir_set_baudrate(struct sh_sir_self *self, u32 baudrate)
        }
 
        clk = clk_get(NULL, "irda_clk");
-       if (!clk) {
+       if (IS_ERR(clk)) {
                dev_err(dev, "can not get irda_clk\n");
                return -EIO;
        }