Commit d3c6ef98 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Mark Brown

ASoC: tegra20: i2s: Use devm_clk_get()

Use resource-managed variant of clk_get() to simplify code.
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-11-digetx@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ca6e960e
...@@ -370,7 +370,7 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ...@@ -370,7 +370,7 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
return PTR_ERR(i2s->reset); return PTR_ERR(i2s->reset);
} }
i2s->clk_i2s = clk_get(&pdev->dev, NULL); i2s->clk_i2s = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(i2s->clk_i2s)) { if (IS_ERR(i2s->clk_i2s)) {
dev_err(&pdev->dev, "Can't retrieve i2s clock\n"); dev_err(&pdev->dev, "Can't retrieve i2s clock\n");
ret = PTR_ERR(i2s->clk_i2s); ret = PTR_ERR(i2s->clk_i2s);
...@@ -381,7 +381,7 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ...@@ -381,7 +381,7 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
regs = devm_ioremap_resource(&pdev->dev, mem); regs = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(regs)) { if (IS_ERR(regs)) {
ret = PTR_ERR(regs); ret = PTR_ERR(regs);
goto err_clk_put; goto err;
} }
i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs, i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
...@@ -389,7 +389,7 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ...@@ -389,7 +389,7 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
if (IS_ERR(i2s->regmap)) { if (IS_ERR(i2s->regmap)) {
dev_err(&pdev->dev, "regmap init failed\n"); dev_err(&pdev->dev, "regmap init failed\n");
ret = PTR_ERR(i2s->regmap); ret = PTR_ERR(i2s->regmap);
goto err_clk_put; goto err;
} }
i2s->capture_dma_data.addr = mem->start + TEGRA20_I2S_FIFO2; i2s->capture_dma_data.addr = mem->start + TEGRA20_I2S_FIFO2;
...@@ -430,16 +430,12 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev) ...@@ -430,16 +430,12 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
tegra20_i2s_runtime_suspend(&pdev->dev); tegra20_i2s_runtime_suspend(&pdev->dev);
err_pm_disable: err_pm_disable:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
err_clk_put:
clk_put(i2s->clk_i2s);
err: err:
return ret; return ret;
} }
static int tegra20_i2s_platform_remove(struct platform_device *pdev) static int tegra20_i2s_platform_remove(struct platform_device *pdev)
{ {
struct tegra20_i2s *i2s = dev_get_drvdata(&pdev->dev);
tegra_pcm_platform_unregister(&pdev->dev); tegra_pcm_platform_unregister(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
...@@ -447,8 +443,6 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev) ...@@ -447,8 +443,6 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev)
if (!pm_runtime_status_suspended(&pdev->dev)) if (!pm_runtime_status_suspended(&pdev->dev))
tegra20_i2s_runtime_suspend(&pdev->dev); tegra20_i2s_runtime_suspend(&pdev->dev);
clk_put(i2s->clk_i2s);
return 0; return 0;
} }
......
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