Browse Source

clk: sunxi: Fix return value check in sun8i_a23_mbus_setup()

In case of error, the function of_io_request_and_map() 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>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Wei Yongjun 9 years ago
parent
commit
fbe359f12c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/clk/sunxi/clk-sun8i-mbus.c

+ 1 - 1
drivers/clk/sunxi/clk-sun8i-mbus.c

@@ -48,7 +48,7 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node)
 		return;
 
 	reg = of_io_request_and_map(node, 0, of_node_full_name(node));
-	if (!reg) {
+	if (IS_ERR(reg)) {
 		pr_err("Could not get registers for sun8i-mbus-clk\n");
 		goto err_free_parents;
 	}