clk: nomadik: Delete error messages for a failed memory allocation in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 20 Apr 2017 08:04:00 +0000 (10:04 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Sat, 22 Apr 2017 02:47:14 +0000 (19:47 -0700)
The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk-nomadik.c

index 8d57ab8..13ad6d1 100644 (file)
@@ -267,10 +267,8 @@ pll_clk_register(struct device *dev, const char *name,
        }
 
        pll = kzalloc(sizeof(*pll), GFP_KERNEL);
-       if (!pll) {
-               pr_err("%s: could not allocate PLL clk\n", __func__);
+       if (!pll)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.ops = &pll_clk_ops;
@@ -356,11 +354,9 @@ src_clk_register(struct device *dev, const char *name,
        struct clk_init_data init;
 
        sclk = kzalloc(sizeof(*sclk), GFP_KERNEL);
-       if (!sclk) {
-               pr_err("could not allocate SRC clock %s\n",
-                       name);
+       if (!sclk)
                return ERR_PTR(-ENOMEM);
-       }
+
        init.name = name;
        init.ops = &src_clk_ops;
        /* Do not force-disable the static SDRAM controller */