mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
thermal: imx8mm: Use dev_err_probe() to simplify error handling
dev_err_probe() can reduce code size, uniform error handling and record the defer probe reason etc., use it to simplify the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/1597129185-8460-2-git-send-email-Anson.Huang@nxp.com
This commit is contained in:
parent
5f3c0200b1
commit
8790710a0f
1 changed files with 3 additions and 7 deletions
|
@ -146,13 +146,9 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(tmu->base);
|
return PTR_ERR(tmu->base);
|
||||||
|
|
||||||
tmu->clk = devm_clk_get(&pdev->dev, NULL);
|
tmu->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(tmu->clk)) {
|
if (IS_ERR(tmu->clk))
|
||||||
ret = PTR_ERR(tmu->clk);
|
return dev_err_probe(&pdev->dev, PTR_ERR(tmu->clk),
|
||||||
if (ret != -EPROBE_DEFER)
|
"failed to get tmu clock\n");
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"failed to get tmu clock: %d\n", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = clk_prepare_enable(tmu->clk);
|
ret = clk_prepare_enable(tmu->clk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Reference in a new issue