浏览代码

ARM: spear: Fix error handling

'clk_get_sys()' returns an error pointer in case of error, not NULL. So
test it with IS_ERR.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Olof Johansson <olof@lixom.net>
Christophe JAILLET 8 年之前
父节点
当前提交
ce34096152
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/arm/mach-spear/time.c

+ 1 - 1
arch/arm/mach-spear/time.c

@@ -233,7 +233,7 @@ void __init spear_setup_of_timer(void)
 	}
 	}
 
 
 	gpt_clk = clk_get_sys("gpt0", NULL);
 	gpt_clk = clk_get_sys("gpt0", NULL);
-	if (!gpt_clk) {
+	if (IS_ERR(gpt_clk)) {
 		pr_err("%s:couldn't get clk for gpt\n", __func__);
 		pr_err("%s:couldn't get clk for gpt\n", __func__);
 		goto err_iomap;
 		goto err_iomap;
 	}
 	}