]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: mmp: Delete error messages for failed memory allocations
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 26 Sep 2017 20:25:38 +0000 (22:25 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 14 Nov 2017 01:40:11 +0000 (17:40 -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>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/mmp/clk-frac.c
drivers/clk/mmp/clk-gate.c
drivers/clk/mmp/clk-mix.c

index 584a9927993b41f73df73f40ec598f4e7d45ca1d..98dfb9568d4f345817aa3c2f4387409783514432 100644 (file)
@@ -172,10 +172,8 @@ struct clk *mmp_clk_register_factor(const char *name, const char *parent_name,
        }
 
        factor = kzalloc(sizeof(*factor), GFP_KERNEL);
-       if (!factor) {
-               pr_err("%s: could not allocate factor  clk\n", __func__);
+       if (!factor)
                return ERR_PTR(-ENOMEM);
-       }
 
        /* struct clk_aux assignments */
        factor->base = base;
index d20cd3431ac27547121d8bc6412c460a45b1ff10..7355595c42e21e4249590b40292cc2a814e7002b 100644 (file)
@@ -103,10 +103,8 @@ struct clk *mmp_clk_register_gate(struct device *dev, const char *name,
 
        /* allocate the gate */
        gate = kzalloc(sizeof(*gate), GFP_KERNEL);
-       if (!gate) {
-               pr_err("%s:%s could not allocate gate clk\n", __func__, name);
+       if (!gate)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.ops = &mmp_clk_gate_ops;
index c554833cffc509a8d2e120c4af5873b8100e3018..1ae532df20f73a9243bb4377fe1da9250b6debd8 100644 (file)
@@ -451,11 +451,8 @@ struct clk *mmp_clk_register_mix(struct device *dev,
        size_t table_bytes;
 
        mix = kzalloc(sizeof(*mix), GFP_KERNEL);
-       if (!mix) {
-               pr_err("%s:%s: could not allocate mmp mix clk\n",
-                       __func__, name);
+       if (!mix)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.flags = flags | CLK_GET_RATE_NOCACHE;
@@ -468,8 +465,6 @@ struct clk *mmp_clk_register_mix(struct device *dev,
                table_bytes = sizeof(*config->table) * config->table_size;
                mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL);
                if (!mix->table) {
-                       pr_err("%s:%s: could not allocate mmp mix table\n",
-                               __func__, name);
                        kfree(mix);
                        return ERR_PTR(-ENOMEM);
                }
@@ -481,8 +476,6 @@ struct clk *mmp_clk_register_mix(struct device *dev,
                mix->mux_table = kmemdup(config->mux_table, table_bytes,
                                         GFP_KERNEL);
                if (!mix->mux_table) {
-                       pr_err("%s:%s: could not allocate mmp mix mux-table\n",
-                               __func__, name);
                        kfree(mix->table);
                        kfree(mix);
                        return ERR_PTR(-ENOMEM);