提交 5cda3fbb 编写于 作者: B Ben Dooks 提交者: Rafael J. Wysocki

PM / clock_ops: report clock errors from clk_enable()

If clk_enable() fails, then print a message so that the user can see
what is happening instead of silently failing to enable the clock.
Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: NIan Molton <ian.molton@codethink.co.uk>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 afdd3ab3
...@@ -32,6 +32,21 @@ struct pm_clock_entry { ...@@ -32,6 +32,21 @@ struct pm_clock_entry {
enum pce_status status; enum pce_status status;
}; };
/**
* pm_clk_enable - Enable a clock, reporting any errors
* @dev: The device for the given clock
* @clk: The clock being enabled.
*/
static inline int __pm_clk_enable(struct device *dev, struct clk *clk)
{
int ret = clk_enable(clk);
if (ret)
dev_err(dev, "%s: failed to enable clk %p, error %d\n",
__func__, clk, ret);
return ret;
}
/** /**
* pm_clk_acquire - Acquire a device clock. * pm_clk_acquire - Acquire a device clock.
* @dev: Device whose clock is to be acquired. * @dev: Device whose clock is to be acquired.
...@@ -263,7 +278,7 @@ int pm_clk_resume(struct device *dev) ...@@ -263,7 +278,7 @@ int pm_clk_resume(struct device *dev)
list_for_each_entry(ce, &psd->clock_list, node) { list_for_each_entry(ce, &psd->clock_list, node) {
if (ce->status < PCE_STATUS_ERROR) { if (ce->status < PCE_STATUS_ERROR) {
ret = clk_enable(ce->clk); ret = __pm_clk_enable(dev, ce->clk);
if (!ret) if (!ret)
ce->status = PCE_STATUS_ENABLED; ce->status = PCE_STATUS_ENABLED;
} }
...@@ -381,7 +396,7 @@ int pm_clk_resume(struct device *dev) ...@@ -381,7 +396,7 @@ int pm_clk_resume(struct device *dev)
spin_lock_irqsave(&psd->lock, flags); spin_lock_irqsave(&psd->lock, flags);
list_for_each_entry(ce, &psd->clock_list, node) list_for_each_entry(ce, &psd->clock_list, node)
clk_enable(ce->clk); __pm_clk_enable(dev, ce->clk);
spin_unlock_irqrestore(&psd->lock, flags); spin_unlock_irqrestore(&psd->lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册