Commit ef12f373 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: img: Use dev_err_probe() helper

Use the dev_err_probe() helper, instead of open-coding the same
operation.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-16-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7a0299e1
...@@ -451,11 +451,9 @@ static int img_i2s_in_probe(struct platform_device *pdev) ...@@ -451,11 +451,9 @@ static int img_i2s_in_probe(struct platform_device *pdev)
i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20); i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20);
i2s->clk_sys = devm_clk_get(dev, "sys"); i2s->clk_sys = devm_clk_get(dev, "sys");
if (IS_ERR(i2s->clk_sys)) { if (IS_ERR(i2s->clk_sys))
if (PTR_ERR(i2s->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(i2s->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(i2s->clk_sys);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
......
...@@ -457,25 +457,19 @@ static int img_i2s_out_probe(struct platform_device *pdev) ...@@ -457,25 +457,19 @@ static int img_i2s_out_probe(struct platform_device *pdev)
i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20); i2s->channel_base = base + (max_i2s_chan_pow_2 * 0x20);
i2s->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst"); i2s->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst");
if (IS_ERR(i2s->rst)) { if (IS_ERR(i2s->rst))
if (PTR_ERR(i2s->rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->rst),
dev_err(&pdev->dev, "No top level reset found\n"); "No top level reset found\n");
return PTR_ERR(i2s->rst);
}
i2s->clk_sys = devm_clk_get(&pdev->dev, "sys"); i2s->clk_sys = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(i2s->clk_sys)) { if (IS_ERR(i2s->clk_sys))
if (PTR_ERR(i2s->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(i2s->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(i2s->clk_sys);
}
i2s->clk_ref = devm_clk_get(&pdev->dev, "ref"); i2s->clk_ref = devm_clk_get(&pdev->dev, "ref");
if (IS_ERR(i2s->clk_ref)) { if (IS_ERR(i2s->clk_ref))
if (PTR_ERR(i2s->clk_ref) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(i2s->clk_ref),
dev_err(dev, "Failed to acquire clock 'ref'\n"); "Failed to acquire clock 'ref'\n");
return PTR_ERR(i2s->clk_ref);
}
i2s->suspend_ch_ctl = devm_kcalloc(dev, i2s->suspend_ch_ctl = devm_kcalloc(dev,
i2s->max_i2s_chan, sizeof(*i2s->suspend_ch_ctl), GFP_KERNEL); i2s->max_i2s_chan, sizeof(*i2s->suspend_ch_ctl), GFP_KERNEL);
......
...@@ -229,25 +229,19 @@ static int img_prl_out_probe(struct platform_device *pdev) ...@@ -229,25 +229,19 @@ static int img_prl_out_probe(struct platform_device *pdev)
prl->base = base; prl->base = base;
prl->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst"); prl->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst");
if (IS_ERR(prl->rst)) { if (IS_ERR(prl->rst))
if (PTR_ERR(prl->rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(prl->rst),
dev_err(&pdev->dev, "No top level reset found\n"); "No top level reset found\n");
return PTR_ERR(prl->rst);
}
prl->clk_sys = devm_clk_get(&pdev->dev, "sys"); prl->clk_sys = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(prl->clk_sys)) { if (IS_ERR(prl->clk_sys))
if (PTR_ERR(prl->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(prl->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(prl->clk_sys);
}
prl->clk_ref = devm_clk_get(&pdev->dev, "ref"); prl->clk_ref = devm_clk_get(&pdev->dev, "ref");
if (IS_ERR(prl->clk_ref)) { if (IS_ERR(prl->clk_ref))
if (PTR_ERR(prl->clk_ref) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(prl->clk_ref),
dev_err(dev, "Failed to acquire clock 'ref'\n"); "Failed to acquire clock 'ref'\n");
return PTR_ERR(prl->clk_ref);
}
ret = clk_prepare_enable(prl->clk_sys); ret = clk_prepare_enable(prl->clk_sys);
if (ret) if (ret)
......
...@@ -739,11 +739,9 @@ static int img_spdif_in_probe(struct platform_device *pdev) ...@@ -739,11 +739,9 @@ static int img_spdif_in_probe(struct platform_device *pdev)
spdif->base = base; spdif->base = base;
spdif->clk_sys = devm_clk_get(dev, "sys"); spdif->clk_sys = devm_clk_get(dev, "sys");
if (IS_ERR(spdif->clk_sys)) { if (IS_ERR(spdif->clk_sys))
if (PTR_ERR(spdif->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdif->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(spdif->clk_sys);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
......
...@@ -342,25 +342,19 @@ static int img_spdif_out_probe(struct platform_device *pdev) ...@@ -342,25 +342,19 @@ static int img_spdif_out_probe(struct platform_device *pdev)
spdif->base = base; spdif->base = base;
spdif->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst"); spdif->rst = devm_reset_control_get_exclusive(&pdev->dev, "rst");
if (IS_ERR(spdif->rst)) { if (IS_ERR(spdif->rst))
if (PTR_ERR(spdif->rst) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(spdif->rst),
dev_err(&pdev->dev, "No top level reset found\n"); "No top level reset found\n");
return PTR_ERR(spdif->rst);
}
spdif->clk_sys = devm_clk_get(&pdev->dev, "sys"); spdif->clk_sys = devm_clk_get(&pdev->dev, "sys");
if (IS_ERR(spdif->clk_sys)) { if (IS_ERR(spdif->clk_sys))
if (PTR_ERR(spdif->clk_sys) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdif->clk_sys),
dev_err(dev, "Failed to acquire clock 'sys'\n"); "Failed to acquire clock 'sys'\n");
return PTR_ERR(spdif->clk_sys);
}
spdif->clk_ref = devm_clk_get(&pdev->dev, "ref"); spdif->clk_ref = devm_clk_get(&pdev->dev, "ref");
if (IS_ERR(spdif->clk_ref)) { if (IS_ERR(spdif->clk_ref))
if (PTR_ERR(spdif->clk_ref) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(spdif->clk_ref),
dev_err(dev, "Failed to acquire clock 'ref'\n"); "Failed to acquire clock 'ref'\n");
return PTR_ERR(spdif->clk_ref);
}
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
......
...@@ -161,12 +161,9 @@ static int pistachio_internal_dac_probe(struct platform_device *pdev) ...@@ -161,12 +161,9 @@ static int pistachio_internal_dac_probe(struct platform_device *pdev)
return PTR_ERR(dac->regmap); return PTR_ERR(dac->regmap);
dac->supply = devm_regulator_get(dev, "VDD"); dac->supply = devm_regulator_get(dev, "VDD");
if (IS_ERR(dac->supply)) { if (IS_ERR(dac->supply))
ret = PTR_ERR(dac->supply); return dev_err_probe(dev, PTR_ERR(dac->supply),
if (ret != -EPROBE_DEFER) "failed to acquire supply 'VDD-supply'\n");
dev_err(dev, "failed to acquire supply 'VDD-supply': %d\n", ret);
return ret;
}
ret = regulator_enable(dac->supply); ret = regulator_enable(dac->supply);
if (ret) { if (ret) {
......
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