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:
Yang Li 2021-06-17 10:22:03 +08:00 committed by Geert Uytterhoeven
parent d42d57fe86
commit 97c2975559
1 changed files with 2 additions and 4 deletions

View File

@ -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;