Skip to content

Commit

Permalink
pwm: tiehrpwm: Handle deferred probe with dev_err_probe()
Browse files Browse the repository at this point in the history
The devm_clk_get() may return -EPROBE_DEFER which is not handled properly
by TI EHRPWM driver and causes unnecessary boot log messages.

Hence, add proper deferred probe handling with new dev_err_probe() API.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Grygorii Strashko authored and Thierry Reding committed Dec 17, 2020
1 parent e3aa45f commit 44db536
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/pwm/pwm-tiehrpwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,8 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
}
}

if (IS_ERR(clk)) {
dev_err(&pdev->dev, "failed to get clock\n");
return PTR_ERR(clk);
}
if (IS_ERR(clk))
return dev_err_probe(&pdev->dev, PTR_ERR(clk), "Failed to get fck\n");

pc->clk_rate = clk_get_rate(clk);
if (!pc->clk_rate) {
Expand All @@ -460,10 +458,8 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)

/* Acquire tbclk for Time Base EHRPWM submodule */
pc->tbclk = devm_clk_get(&pdev->dev, "tbclk");
if (IS_ERR(pc->tbclk)) {
dev_err(&pdev->dev, "Failed to get tbclk\n");
return PTR_ERR(pc->tbclk);
}
if (IS_ERR(pc->tbclk))
return dev_err_probe(&pdev->dev, PTR_ERR(pc->tbclk), "Failed to get tbclk\n");

ret = clk_prepare(pc->tbclk);
if (ret < 0) {
Expand Down

0 comments on commit 44db536

Please sign in to comment.