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 <sjg@chromium.org>
This commit is contained in:
Simon Glass 2021-01-21 13:57:11 -07:00
parent ef79ef21a8
commit 5c5992cb90

View File

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