Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: Propagate any error return from debug_init()

If the .debug_init op is provided, it will be called by
clk_debug_create_one(). If debug_init() returns an error code,
clk_debug_create_one() will return -ENOMEM, regardless of the
value returned from debug_init(). Tweak the code to return
the actual value returned by debug_init() instead.

Signed-off-by: Chris Brand <chris.brand@linaro.org>
Reviewed-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>

authored by

Chris Brand and committed by
Mike Turquette
abeab450 d14c17b2

+4 -2
+4 -2
drivers/clk/clk.c
··· 284 284 if (!d) 285 285 goto err_out; 286 286 287 - if (clk->ops->debug_init) 288 - if (clk->ops->debug_init(clk->hw, clk->dentry)) 287 + if (clk->ops->debug_init) { 288 + ret = clk->ops->debug_init(clk->hw, clk->dentry); 289 + if (ret) 289 290 goto err_out; 291 + } 290 292 291 293 ret = 0; 292 294 goto out;