clk: sunxi: Fix return value check in sun8i_a23_mbus_setup()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 6 Jul 2016 12:21:47 +0000 (12:21 +0000)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 8 Aug 2016 17:27:33 +0000 (19:27 +0200)
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>
drivers/clk/sunxi/clk-sun8i-mbus.c

index 411d3033a96e9a729fd9b289cf390344a17f415f..b200ebf159eec42b3c46970c318fef053cfa468e 100644 (file)
@@ -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;
        }