]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: spear: Delete error messages for failed memory allocations
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 27 Sep 2017 16:00:21 +0000 (18:00 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 14 Nov 2017 01:41:53 +0000 (17:41 -0800)
Omit extra messages for a memory allocation failure in these
functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/spear/clk-aux-synth.c
drivers/clk/spear/clk-frac-synth.c
drivers/clk/spear/clk-gpt-synth.c
drivers/clk/spear/clk-vco-pll.c

index f271c350ef9404838fcaa6502db28cd1db5a744c..ee7a7c043e3b3911f61783ba3b068916ffd04cff 100644 (file)
@@ -149,10 +149,8 @@ struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
        }
 
        aux = kzalloc(sizeof(*aux), GFP_KERNEL);
-       if (!aux) {
-               pr_err("could not allocate aux clk\n");
+       if (!aux)
                return ERR_PTR(-ENOMEM);
-       }
 
        /* struct clk_aux assignments */
        if (!masks)
index 58d678b5b40a76c6e426b41ed957e044197b2ae8..c48f3ed2d5706dea4c95da79587155f956099cfc 100644 (file)
@@ -136,10 +136,8 @@ struct clk *clk_register_frac(const char *name, const char *parent_name,
        }
 
        frac = kzalloc(sizeof(*frac), GFP_KERNEL);
-       if (!frac) {
-               pr_err("could not allocate frac clk\n");
+       if (!frac)
                return ERR_PTR(-ENOMEM);
-       }
 
        /* struct clk_frac assignments */
        frac->reg = reg;
index 1a722e99e76e949352ab03120440ec3e312c365d..6e95d7f3ade9e7c4c57845d17fdede461266519b 100644 (file)
@@ -125,10 +125,8 @@ struct clk *clk_register_gpt(const char *name, const char *parent_name, unsigned
        }
 
        gpt = kzalloc(sizeof(*gpt), GFP_KERNEL);
-       if (!gpt) {
-               pr_err("could not allocate gpt clk\n");
+       if (!gpt)
                return ERR_PTR(-ENOMEM);
-       }
 
        /* struct clk_gpt assignments */
        gpt->reg = reg;
index dc21ca4601aab28ce2eba866e2d00e0e33f9dbe1..e06b821fa60e03fb7552320a616b8611732450f2 100644 (file)
@@ -292,16 +292,12 @@ struct clk *clk_register_vco_pll(const char *vco_name, const char *pll_name,
        }
 
        vco = kzalloc(sizeof(*vco), GFP_KERNEL);
-       if (!vco) {
-               pr_err("could not allocate vco clk\n");
+       if (!vco)
                return ERR_PTR(-ENOMEM);
-       }
 
        pll = kzalloc(sizeof(*pll), GFP_KERNEL);
-       if (!pll) {
-               pr_err("could not allocate pll clk\n");
+       if (!pll)
                goto free_vco;
-       }
 
        /* struct clk_vco assignments */
        vco->mode_reg = mode_reg;