mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
clk: basic-types: Remove useless allocation failure printks
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>
This commit is contained in:
parent
e0cdcda508
commit
d122db7e86
6 changed files with 9 additions and 21 deletions
|
@ -200,10 +200,8 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
|
||||||
struct clk_ops *clk_composite_ops;
|
struct clk_ops *clk_composite_ops;
|
||||||
|
|
||||||
composite = kzalloc(sizeof(*composite), GFP_KERNEL);
|
composite = kzalloc(sizeof(*composite), GFP_KERNEL);
|
||||||
if (!composite) {
|
if (!composite)
|
||||||
pr_err("%s: could not allocate composite clk\n", __func__);
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
init.name = name;
|
init.name = name;
|
||||||
init.flags = flags | CLK_IS_BASIC;
|
init.flags = flags | CLK_IS_BASIC;
|
||||||
|
|
|
@ -430,11 +430,9 @@ static struct clk *_register_divider(struct device *dev, const char *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate the divider */
|
/* allocate the divider */
|
||||||
div = kzalloc(sizeof(struct clk_divider), GFP_KERNEL);
|
div = kzalloc(sizeof(*div), GFP_KERNEL);
|
||||||
if (!div) {
|
if (!div)
|
||||||
pr_err("%s: could not allocate divider clk\n", __func__);
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
init.name = name;
|
init.name = name;
|
||||||
init.ops = &clk_divider_ops;
|
init.ops = &clk_divider_ops;
|
||||||
|
|
|
@ -74,10 +74,8 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
|
|
||||||
fix = kmalloc(sizeof(*fix), GFP_KERNEL);
|
fix = kmalloc(sizeof(*fix), GFP_KERNEL);
|
||||||
if (!fix) {
|
if (!fix)
|
||||||
pr_err("%s: could not allocate fixed factor clk\n", __func__);
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
/* struct clk_fixed_factor assignments */
|
/* struct clk_fixed_factor assignments */
|
||||||
fix->mult = mult;
|
fix->mult = mult;
|
||||||
|
|
|
@ -65,11 +65,9 @@ struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
|
||||||
struct clk_init_data init;
|
struct clk_init_data init;
|
||||||
|
|
||||||
/* allocate fixed-rate clock */
|
/* allocate fixed-rate clock */
|
||||||
fixed = kzalloc(sizeof(struct clk_fixed_rate), GFP_KERNEL);
|
fixed = kzalloc(sizeof(*fixed), GFP_KERNEL);
|
||||||
if (!fixed) {
|
if (!fixed)
|
||||||
pr_err("%s: could not allocate fixed clk\n", __func__);
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
init.name = name;
|
init.name = name;
|
||||||
init.ops = &clk_fixed_rate_ops;
|
init.ops = &clk_fixed_rate_ops;
|
||||||
|
|
|
@ -109,10 +109,8 @@ struct clk *clk_register_fractional_divider(struct device *dev,
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
|
|
||||||
fd = kzalloc(sizeof(*fd), GFP_KERNEL);
|
fd = kzalloc(sizeof(*fd), GFP_KERNEL);
|
||||||
if (!fd) {
|
if (!fd)
|
||||||
dev_err(dev, "could not allocate fractional divider clk\n");
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
init.name = name;
|
init.name = name;
|
||||||
init.ops = &clk_fractional_divider_ops;
|
init.ops = &clk_fractional_divider_ops;
|
||||||
|
|
|
@ -135,11 +135,9 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate the gate */
|
/* allocate the gate */
|
||||||
gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL);
|
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
|
||||||
if (!gate) {
|
if (!gate)
|
||||||
pr_err("%s: could not allocate gated clk\n", __func__);
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
init.name = name;
|
init.name = name;
|
||||||
init.ops = &clk_gate_ops;
|
init.ops = &clk_gate_ops;
|
||||||
|
|
Loading…
Add table
Reference in a new issue