From: Chris Brand Date: Thu, 3 Jul 2014 21:01:29 +0000 (-0700) Subject: clk: Propagate any error return from debug_init() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=abeab450bfe823079c8a3abf5123f41a0da62392;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Matt Porter Reviewed-by: Alex Elder Signed-off-by: Mike Turquette --- diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index f95590a1e28e..b76fa69b44cb 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -284,9 +284,11 @@ static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry) if (!d) goto err_out; - if (clk->ops->debug_init) - if (clk->ops->debug_init(clk->hw, clk->dentry)) + if (clk->ops->debug_init) { + ret = clk->ops->debug_init(clk->hw, clk->dentry); + if (ret) goto err_out; + } ret = 0; goto out;