From: Markus Elfring Date: Tue, 26 Sep 2017 17:30:46 +0000 (+0200) Subject: clk: clk-u300: Delete error messages for failed memory allocations X-Git-Tag: v4.15-rc1~48^2^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de8cd467e413906265eaa1f8af8d2da0f0d63c40;p=thirdparty%2Fkernel%2Flinux.git clk: clk-u300: 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 Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c index ec8aafda6e243..e524c37752648 100644 --- a/drivers/clk/clk-u300.c +++ b/drivers/clk/clk-u300.c @@ -703,11 +703,9 @@ syscon_clk_register(struct device *dev, const char *name, int ret; sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL); - if (!sclk) { - pr_err("could not allocate syscon clock %s\n", - name); + if (!sclk) return ERR_PTR(-ENOMEM); - } + init.name = name; init.ops = &syscon_clk_ops; init.flags = flags; @@ -1124,11 +1122,9 @@ mclk_clk_register(struct device *dev, const char *name, int ret; mclk = kzalloc(sizeof(struct clk_mclk), GFP_KERNEL); - if (!mclk) { - pr_err("could not allocate MMC/SD clock %s\n", - name); + if (!mclk) return ERR_PTR(-ENOMEM); - } + init.name = "mclk"; init.ops = &mclk_ops; init.flags = 0;