Skip to content

Commit 97c2975

Browse files
Yang Ligeertu
authored andcommitted
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>
1 parent d42d57f commit 97c2975

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/clk/renesas/renesas-rzg2l-cpg.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,8 @@ rzg2l_cpg_pll_clk_register(const struct cpg_core_clk *core,
182182
return ERR_CAST(parent);
183183

184184
pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
185-
if (!pll_clk) {
186-
clk = ERR_PTR(-ENOMEM);
187-
return NULL;
188-
}
185+
if (!pll_clk)
186+
return ERR_PTR(-ENOMEM);
189187

190188
parent_name = __clk_get_name(parent);
191189
init.name = core->name;

0 commit comments

Comments
 (0)