ASoC: ti: Use dev_err_probe() helper

Use the dev_err_probe() helper, instead of open-coding the same
operation.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-13-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2021-12-14 11:08:33 +09:00 committed by Mark Brown
parent 0624dafa6a
commit 88fb6da3f4
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 6 additions and 14 deletions

View File

@ -2024,13 +2024,9 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp)
tmp = mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK].filter_data;
chan = dma_request_chan(mcasp->dev, tmp);
if (IS_ERR(chan)) {
if (PTR_ERR(chan) != -EPROBE_DEFER)
dev_err(mcasp->dev,
"Can't verify DMA configuration (%ld)\n",
PTR_ERR(chan));
return PTR_ERR(chan);
}
if (IS_ERR(chan))
return dev_err_probe(mcasp->dev, PTR_ERR(chan),
"Can't verify DMA configuration\n");
if (WARN_ON(!chan->device || !chan->device->dev)) {
dma_release_channel(chan);
return -EINVAL;

View File

@ -464,13 +464,9 @@ static int j721e_get_clocks(struct device *dev,
int ret;
clocks->target = devm_clk_get(dev, prefix);
if (IS_ERR(clocks->target)) {
ret = PTR_ERR(clocks->target);
if (ret != -EPROBE_DEFER)
dev_err(dev, "failed to acquire %s: %d\n",
prefix, ret);
return ret;
}
if (IS_ERR(clocks->target))
return dev_err_probe(dev, PTR_ERR(clocks->target),
"failed to acquire %s\n", prefix);
clk_name = kasprintf(GFP_KERNEL, "%s-48000", prefix);
if (clk_name) {