clk: renesas: cpg-mssr: Initialize error pointer using ERR_PTR()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 17 May 2017 13:43:56 +0000 (15:43 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 24 May 2017 08:19:24 +0000 (10:19 +0200)
Coccinelle warns:

    drivers/clk/renesas/renesas-cpg-mssr.c:323:14-21: ERROR: PTR_ERR applied after initialization to constant on line 260

Initialize clk using ERR_PTR(-ENOTSUPP) instead of NULL to fix this.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/clk/renesas/renesas-cpg-mssr.c

index 38a01406740dfc04e8da30ea49aca19eb2f69616..51d4af0a53ec2d382b9519714e0c8eb616b68e94 100644 (file)
@@ -257,7 +257,7 @@ static void __init cpg_mssr_register_core_clk(const struct cpg_core_clk *core,
                                              const struct cpg_mssr_info *info,
                                              struct cpg_mssr_priv *priv)
 {
-       struct clk *clk = NULL, *parent;
+       struct clk *clk = ERR_PTR(-ENOTSUPP), *parent;
        struct device *dev = priv->dev;
        unsigned int id = core->id, div = core->div;
        const char *parent_name;