Commit 526f6ca9 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: codecs: pcm3168a: 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-6-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent edfe9f45
...@@ -751,21 +751,14 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap) ...@@ -751,21 +751,14 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
pcm3168a->gpio_rst = devm_gpiod_get_optional(dev, "reset", pcm3168a->gpio_rst = devm_gpiod_get_optional(dev, "reset",
GPIOD_OUT_LOW | GPIOD_OUT_LOW |
GPIOD_FLAGS_BIT_NONEXCLUSIVE); GPIOD_FLAGS_BIT_NONEXCLUSIVE);
if (IS_ERR(pcm3168a->gpio_rst)) { if (IS_ERR(pcm3168a->gpio_rst))
ret = PTR_ERR(pcm3168a->gpio_rst); return dev_err_probe(dev, PTR_ERR(pcm3168a->gpio_rst),
if (ret != -EPROBE_DEFER ) "failed to acquire RST gpio\n");
dev_err(dev, "failed to acquire RST gpio: %d\n", ret);
return ret;
}
pcm3168a->scki = devm_clk_get(dev, "scki"); pcm3168a->scki = devm_clk_get(dev, "scki");
if (IS_ERR(pcm3168a->scki)) { if (IS_ERR(pcm3168a->scki))
ret = PTR_ERR(pcm3168a->scki); return dev_err_probe(dev, PTR_ERR(pcm3168a->scki),
if (ret != -EPROBE_DEFER) "failed to acquire clock 'scki'\n");
dev_err(dev, "failed to acquire clock 'scki': %d\n", ret);
return ret;
}
ret = clk_prepare_enable(pcm3168a->scki); ret = clk_prepare_enable(pcm3168a->scki);
if (ret) { if (ret) {
...@@ -781,8 +774,7 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap) ...@@ -781,8 +774,7 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap)
ret = devm_regulator_bulk_get(dev, ret = devm_regulator_bulk_get(dev,
ARRAY_SIZE(pcm3168a->supplies), pcm3168a->supplies); ARRAY_SIZE(pcm3168a->supplies), pcm3168a->supplies);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "failed to request supplies\n");
dev_err(dev, "failed to request supplies: %d\n", ret);
goto err_clk; goto err_clk;
} }
......
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