clk: mmp: Delete error messages for failed memory allocations

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>
This commit is contained in:
Markus Elfring 2017-09-26 22:25:38 +02:00 committed by Stephen Boyd
parent 62c73ed5bf
commit 1cc36f7300
3 changed files with 3 additions and 14 deletions

View file

@ -172,10 +172,8 @@ struct clk *mmp_clk_register_factor(const char *name, const char *parent_name,
} }
factor = kzalloc(sizeof(*factor), GFP_KERNEL); factor = kzalloc(sizeof(*factor), GFP_KERNEL);
if (!factor) { if (!factor)
pr_err("%s: could not allocate factor clk\n", __func__);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
/* struct clk_aux assignments */ /* struct clk_aux assignments */
factor->base = base; factor->base = base;

View file

@ -103,10 +103,8 @@ struct clk *mmp_clk_register_gate(struct device *dev, const char *name,
/* allocate the gate */ /* allocate the gate */
gate = kzalloc(sizeof(*gate), GFP_KERNEL); gate = kzalloc(sizeof(*gate), GFP_KERNEL);
if (!gate) { if (!gate)
pr_err("%s:%s could not allocate gate clk\n", __func__, name);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
init.name = name; init.name = name;
init.ops = &mmp_clk_gate_ops; init.ops = &mmp_clk_gate_ops;

View file

@ -451,11 +451,8 @@ struct clk *mmp_clk_register_mix(struct device *dev,
size_t table_bytes; size_t table_bytes;
mix = kzalloc(sizeof(*mix), GFP_KERNEL); mix = kzalloc(sizeof(*mix), GFP_KERNEL);
if (!mix) { if (!mix)
pr_err("%s:%s: could not allocate mmp mix clk\n",
__func__, name);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
init.name = name; init.name = name;
init.flags = flags | CLK_GET_RATE_NOCACHE; 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; table_bytes = sizeof(*config->table) * config->table_size;
mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL); mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL);
if (!mix->table) { if (!mix->table) {
pr_err("%s:%s: could not allocate mmp mix table\n",
__func__, name);
kfree(mix); kfree(mix);
return ERR_PTR(-ENOMEM); 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, mix->mux_table = kmemdup(config->mux_table, table_bytes,
GFP_KERNEL); GFP_KERNEL);
if (!mix->mux_table) { if (!mix->mux_table) {
pr_err("%s:%s: could not allocate mmp mix mux-table\n",
__func__, name);
kfree(mix->table); kfree(mix->table);
kfree(mix); kfree(mix);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);