]> git.karo-electronics.de Git - linux-beck.git/commitdiff
clk: basic-types: Remove useless allocation failure printks
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 14 May 2015 23:47:10 +0000 (16:47 -0700)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 14 May 2015 23:51:50 +0000 (16:51 -0700)
Printing an error on kmalloc() failures is unnecessary. Remove
the print and use *ptr in sizeof() for future-proof code.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk-composite.c
drivers/clk/clk-divider.c
drivers/clk/clk-fixed-factor.c
drivers/clk/clk-fixed-rate.c
drivers/clk/clk-fractional-divider.c
drivers/clk/clk-gate.c

index 077f4c7148f1261eb7a3778dd533bd820b9c5368..616f5aef3c26c7ad24334b1291d7d8178ef76ede 100644 (file)
@@ -200,10 +200,8 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
        struct clk_ops *clk_composite_ops;
 
        composite = kzalloc(sizeof(*composite), GFP_KERNEL);
-       if (!composite) {
-               pr_err("%s: could not allocate composite clk\n", __func__);
+       if (!composite)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.flags = flags | CLK_IS_BASIC;
index 25006a8bb8e6d5af8d145472fc76e2ef45281f09..706b5783c360dfc5ba60c6f7054374f5f06ff4f8 100644 (file)
@@ -430,11 +430,9 @@ static struct clk *_register_divider(struct device *dev, const char *name,
        }
 
        /* allocate the divider */
-       div = kzalloc(sizeof(struct clk_divider), GFP_KERNEL);
-       if (!div) {
-               pr_err("%s: could not allocate divider clk\n", __func__);
+       div = kzalloc(sizeof(*div), GFP_KERNEL);
+       if (!div)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.ops = &clk_divider_ops;
index d9e3f671c2ea634012982c2228493cba8eb71903..e186db263d5ea8fde61f94f1428c7e2c57eebab4 100644 (file)
@@ -74,10 +74,8 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
        struct clk *clk;
 
        fix = kmalloc(sizeof(*fix), GFP_KERNEL);
-       if (!fix) {
-               pr_err("%s: could not allocate fixed factor clk\n", __func__);
+       if (!fix)
                return ERR_PTR(-ENOMEM);
-       }
 
        /* struct clk_fixed_factor assignments */
        fix->mult = mult;
index 0fc56ab6e844c88493e68f86b6a1fed8884a516e..f85ec8d1711fb7f36ac2e724308745dbf7b1ef47 100644 (file)
@@ -65,11 +65,9 @@ struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
        struct clk_init_data init;
 
        /* allocate fixed-rate clock */
-       fixed = kzalloc(sizeof(struct clk_fixed_rate), GFP_KERNEL);
-       if (!fixed) {
-               pr_err("%s: could not allocate fixed clk\n", __func__);
+       fixed = kzalloc(sizeof(*fixed), GFP_KERNEL);
+       if (!fixed)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.ops = &clk_fixed_rate_ops;
index 6aa72d9d79bad43d5c8f79f47fa30134d710a624..140eb5844dc4b86d1fb6b7034b5c375117dee0f8 100644 (file)
@@ -109,10 +109,8 @@ struct clk *clk_register_fractional_divider(struct device *dev,
        struct clk *clk;
 
        fd = kzalloc(sizeof(*fd), GFP_KERNEL);
-       if (!fd) {
-               dev_err(dev, "could not allocate fractional divider clk\n");
+       if (!fd)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.ops = &clk_fractional_divider_ops;
index 3f0e4200cb5d4ca4a680c78479ac86ed116766a5..551dd067279402abbd45685315ee9df1c5f7c5d5 100644 (file)
@@ -135,11 +135,9 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
        }
 
        /* allocate the gate */
-       gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL);
-       if (!gate) {
-               pr_err("%s: could not allocate gated clk\n", __func__);
+       gate = kzalloc(sizeof(*gate), GFP_KERNEL);
+       if (!gate)
                return ERR_PTR(-ENOMEM);
-       }
 
        init.name = name;
        init.ops = &clk_gate_ops;