Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Markus Elfring and committed by
Stephen Boyd
1cc36f73 62c73ed5

+3 -14
+1 -3
drivers/clk/mmp/clk-frac.c
··· 172 172 } 173 173 174 174 factor = kzalloc(sizeof(*factor), GFP_KERNEL); 175 - if (!factor) { 176 - pr_err("%s: could not allocate factor clk\n", __func__); 175 + if (!factor) 177 176 return ERR_PTR(-ENOMEM); 178 - } 179 177 180 178 /* struct clk_aux assignments */ 181 179 factor->base = base;
+1 -3
drivers/clk/mmp/clk-gate.c
··· 103 103 104 104 /* allocate the gate */ 105 105 gate = kzalloc(sizeof(*gate), GFP_KERNEL); 106 - if (!gate) { 107 - pr_err("%s:%s could not allocate gate clk\n", __func__, name); 106 + if (!gate) 108 107 return ERR_PTR(-ENOMEM); 109 - } 110 108 111 109 init.name = name; 112 110 init.ops = &mmp_clk_gate_ops;
+1 -8
drivers/clk/mmp/clk-mix.c
··· 451 451 size_t table_bytes; 452 452 453 453 mix = kzalloc(sizeof(*mix), GFP_KERNEL); 454 - if (!mix) { 455 - pr_err("%s:%s: could not allocate mmp mix clk\n", 456 - __func__, name); 454 + if (!mix) 457 455 return ERR_PTR(-ENOMEM); 458 - } 459 456 460 457 init.name = name; 461 458 init.flags = flags | CLK_GET_RATE_NOCACHE; ··· 465 468 table_bytes = sizeof(*config->table) * config->table_size; 466 469 mix->table = kmemdup(config->table, table_bytes, GFP_KERNEL); 467 470 if (!mix->table) { 468 - pr_err("%s:%s: could not allocate mmp mix table\n", 469 - __func__, name); 470 471 kfree(mix); 471 472 return ERR_PTR(-ENOMEM); 472 473 } ··· 476 481 mix->mux_table = kmemdup(config->mux_table, table_bytes, 477 482 GFP_KERNEL); 478 483 if (!mix->mux_table) { 479 - pr_err("%s:%s: could not allocate mmp mix mux-table\n", 480 - __func__, name); 481 484 kfree(mix->table); 482 485 kfree(mix); 483 486 return ERR_PTR(-ENOMEM);