clocksource: fix a missing check of clk_prepare
PATCH 1/1 clocksource: fix a missing check of clk_prepare
clk_prepare() could fail, so let's check its status, and if it fails, issue an error message.
Signed-off-by Kangjie Lu <[email protected]>
--- drivers/clocksource/sh_cmt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clocksource/sh_cmt.c +4 -1
@@ -764,7 +764,10 @@ static void sh_cmt_clock_event_resume(struct clock_event_device *ced) {struct sh_cmt_channel *ch =ced_to_sh_cmt (ced); -clk_prepare (ch->cmt->clk); +if (clk_prepare (ch->cmt->clk)) +dev_err (&ch->cmt->pdev->dev,"ch%u: failed to prepare clk\n" , + ch->index); +pm_genpd_syscore_poweron (&ch->cmt->pdev->dev); }
Signature · 1 line
2.17.2 (Apple Git-113)