From: Simon Glass Date: Thu, 21 Jan 2021 20:57:11 +0000 (-0700) Subject: clk: Add debugging for return values X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=5c5992cb90cf9ca4d51e38d9a95a13c293904df5;p=u-boot.git clk: Add debugging for return values Use the log_msg_ret() mechanism to get error-return information when clocks fail to probe, etc. Signed-off-by: Simon Glass --- diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index b75056718b..d5c4e3cbe5 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -83,7 +83,7 @@ static int clk_get_by_index_tail(int ret, ofnode node, if (ret) { debug("%s: uclass_get_device_by_of_offset failed: err=%d\n", __func__, ret); - return ret; + return log_msg_ret("get", ret); } clk->dev = dev_clk; @@ -96,14 +96,15 @@ static int clk_get_by_index_tail(int ret, ofnode node, ret = clk_of_xlate_default(clk, args); if (ret) { debug("of_xlate() failed: %d\n", ret); - return ret; + return log_msg_ret("xlate", ret); } return clk_request(dev_clk, clk); err: debug("%s: Node '%s', property '%s', failed to request CLK index %d: %d\n", __func__, ofnode_get_name(node), list_name, index, ret); - return ret; + + return log_msg_ret("prop", ret); } static int clk_get_by_indexed_prop(struct udevice *dev, const char *prop_name, @@ -122,7 +123,7 @@ static int clk_get_by_indexed_prop(struct udevice *dev, const char *prop_name, if (ret) { debug("%s: fdtdec_parse_phandle_with_args failed: err=%d\n", __func__, ret); - return ret; + return log_ret(ret); } @@ -470,6 +471,7 @@ int clk_free(struct clk *clk) ulong clk_get_rate(struct clk *clk) { const struct clk_ops *ops; + int ret; debug("%s(clk=%p)\n", __func__, clk); if (!clk_valid(clk)) @@ -479,7 +481,11 @@ ulong clk_get_rate(struct clk *clk) if (!ops->get_rate) return -ENOSYS; - return ops->get_rate(clk); + ret = ops->get_rate(clk); + if (ret) + return log_ret(ret); + + return 0; } struct clk *clk_get_parent(struct clk *clk)