#include <linux/bug.h>
#include <linux/clk-provider.h>
#include <linux/err.h>
+#include <asm/global_data.h>
static inline const struct clk_ops *clk_dev_ops(struct udevice *dev)
{
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;
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,
if (ret) {
debug("%s: fdtdec_parse_phandle_with_args failed: err=%d\n",
__func__, ret);
- return ret;
+ return log_ret(ret);
}
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))
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)