clk: renesas: rzg2l: Fix return value and unused assignment
Currently the function returns NULL on error, so exact error code is lost. This patch changes return convention of the function to use ERR_PTR() on error instead. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/1623896524-102058-1-git-send-email-yang.lee@linux.alibaba.com [geert: Drop curly braces] Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
This commit is contained in:
parent
d42d57fe86
commit
97c2975559
|
@ -182,10 +182,8 @@ rzg2l_cpg_pll_clk_register(const struct cpg_core_clk *core,
|
||||||
return ERR_CAST(parent);
|
return ERR_CAST(parent);
|
||||||
|
|
||||||
pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
|
pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
|
||||||
if (!pll_clk) {
|
if (!pll_clk)
|
||||||
clk = ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent_name = __clk_get_name(parent);
|
parent_name = __clk_get_name(parent);
|
||||||
init.name = core->name;
|
init.name = core->name;
|
||||||
|
|
Loading…
Reference in New Issue