[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1466183465-23179-1-git-send-email-weiyj_lk@163.com>
Date: Fri, 17 Jun 2016 17:11:05 +0000
From: weiyj_lk@....com
To: Ralf Baechle <ralf@...ux-mips.org>
Cc: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Subject: [PATCH] MIPS: ath79: Fix return value check in ath79_reg_ffclk()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
In case of error, the function clk_register_fixed_factor() 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@...ndmicro.com.cn>
---
arch/mips/ath79/clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 2e73784..cc3a1e3 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -96,7 +96,7 @@ static struct clk * __init ath79_reg_ffclk(const char *name,
struct clk *clk;
clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mult, div);
- if (!clk)
+ if (IS_ERR(clk))
panic("failed to allocate %s clock structure", name);
return clk;
Powered by blists - more mailing lists