diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-08-07 22:55:59 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2022-09-15 13:13:40 +0200 |
commit | c18f3524422dd28d2049f9ad3822a70e918a340d (patch) | |
tree | 46aa4c9344602326183e88adbbadcacce4f1cc32 /drivers/soc/tegra | |
parent | soc/tegra: fuse: Drop Kconfig dependency on TEGRA20_APB_DMA (diff) | |
download | linux-c18f3524422dd28d2049f9ad3822a70e918a340d.tar.xz linux-c18f3524422dd28d2049f9ad3822a70e918a340d.zip |
soc/tegra: pmc: Use devm_clk_get_optional()
Use devm_clk_get_optional() instead of hand writing it.
While at it, use dev_err_probe() to further simplify the code. This is also
less verbose if clk_get() returns -EPROBE_DEFER.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc/tegra')
-rw-r--r-- | drivers/soc/tegra/pmc.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 03d614acd521..961b2de16307 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -2904,17 +2904,10 @@ static int tegra_pmc_probe(struct platform_device *pdev) pmc->scratch = base; } - pmc->clk = devm_clk_get(&pdev->dev, "pclk"); - if (IS_ERR(pmc->clk)) { - err = PTR_ERR(pmc->clk); - - if (err != -ENOENT) { - dev_err(&pdev->dev, "failed to get pclk: %d\n", err); - return err; - } - - pmc->clk = NULL; - } + pmc->clk = devm_clk_get_optional(&pdev->dev, "pclk"); + if (IS_ERR(pmc->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(pmc->clk), + "failed to get pclk\n"); /* * PMC should be last resort for restarting since it soft-resets |