Commit 4569e604 authored by Kartik's avatar Kartik Committed by Thierry Reding

soc/tegra: fuse: Use dev_err_probe for probe failures

Currently, in tegra_fuse_probe() if clock/reset get fails, then the
driver prints an error if the error is not caused by -EPROBE_DEFER.
This can be improved by using dev_err_probe() instead.

So, return dev_err_probe() if clock/reset get fails.
Signed-off-by: default avatarKartik <kkartik@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 7092e9b3
...@@ -131,13 +131,8 @@ static int tegra_fuse_probe(struct platform_device *pdev) ...@@ -131,13 +131,8 @@ static int tegra_fuse_probe(struct platform_device *pdev)
fuse->phys = res->start; fuse->phys = res->start;
fuse->clk = devm_clk_get(&pdev->dev, "fuse"); fuse->clk = devm_clk_get(&pdev->dev, "fuse");
if (IS_ERR(fuse->clk)) { if (IS_ERR(fuse->clk))
if (PTR_ERR(fuse->clk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(fuse->clk), "failed to get FUSE clock\n");
dev_err(&pdev->dev, "failed to get FUSE clock: %ld",
PTR_ERR(fuse->clk));
return PTR_ERR(fuse->clk);
}
platform_set_drvdata(pdev, fuse); platform_set_drvdata(pdev, fuse);
fuse->dev = &pdev->dev; fuse->dev = &pdev->dev;
...@@ -179,12 +174,8 @@ static int tegra_fuse_probe(struct platform_device *pdev) ...@@ -179,12 +174,8 @@ static int tegra_fuse_probe(struct platform_device *pdev)
} }
fuse->rst = devm_reset_control_get_optional(&pdev->dev, "fuse"); fuse->rst = devm_reset_control_get_optional(&pdev->dev, "fuse");
if (IS_ERR(fuse->rst)) { if (IS_ERR(fuse->rst))
err = PTR_ERR(fuse->rst); return dev_err_probe(&pdev->dev, PTR_ERR(fuse->rst), "failed to get FUSE reset\n");
dev_err(&pdev->dev, "failed to get FUSE reset: %pe\n",
fuse->rst);
return err;
}
/* /*
* FUSE clock is enabled at a boot time, hence this resume/suspend * FUSE clock is enabled at a boot time, hence this resume/suspend
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment