ASoC: samsung: 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-21-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:41 +09:00 committed by Mark Brown
parent b3a66d22a2
commit 27c6eaebcf
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
11 changed files with 26 additions and 40 deletions

View File

@ -585,19 +585,16 @@ static int aries_audio_probe(struct platform_device *pdev)
extcon_np = of_parse_phandle(np, "extcon", 0);
priv->usb_extcon = extcon_find_edev_by_node(extcon_np);
if (IS_ERR(priv->usb_extcon)) {
if (PTR_ERR(priv->usb_extcon) != -EPROBE_DEFER)
dev_err(dev, "Failed to get extcon device");
return PTR_ERR(priv->usb_extcon);
}
if (IS_ERR(priv->usb_extcon))
return dev_err_probe(dev, PTR_ERR(priv->usb_extcon),
"Failed to get extcon device");
of_node_put(extcon_np);
priv->adc = devm_iio_channel_get(dev, "headset-detect");
if (IS_ERR(priv->adc)) {
if (PTR_ERR(priv->adc) != -EPROBE_DEFER)
dev_err(dev, "Failed to get ADC channel");
return PTR_ERR(priv->adc);
}
if (IS_ERR(priv->adc))
return dev_err_probe(dev, PTR_ERR(priv->adc),
"Failed to get ADC channel");
if (priv->adc->channel->type != IIO_VOLTAGE)
return -EINVAL;

View File

@ -174,9 +174,8 @@ static int arndale_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(card->dev, card);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev,
"snd_soc_register_card() failed: %d\n", ret);
dev_err_probe(&pdev->dev, ret,
"snd_soc_register_card() failed\n");
goto err_put_of_nodes;
}
return 0;

View File

@ -325,9 +325,8 @@ static int littlemill_probe(struct platform_device *pdev)
card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
return ret;
}

View File

@ -183,9 +183,8 @@ static int lowland_probe(struct platform_device *pdev)
card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
return ret;
}

View File

@ -311,9 +311,7 @@ static int odroid_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(dev, card);
if (ret < 0) {
if (ret != -EPROBE_DEFER)
dev_err(dev, "snd_soc_register_card() failed: %d\n",
ret);
dev_err_probe(dev, ret, "snd_soc_register_card() failed\n");
goto err_put_clk_i2s;
}

View File

@ -179,8 +179,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card() failed:%d\n", ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
return ret;
}

View File

@ -118,8 +118,8 @@ static int snd_smdk_probe(struct platform_device *pdev)
smdk_pcm.dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
return ret;
}

View File

@ -212,12 +212,9 @@ static int snow_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, priv);
ret = devm_snd_soc_register_card(dev, card);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev,
"snd_soc_register_card failed (%d)\n", ret);
return ret;
}
if (ret)
return dev_err_probe(&pdev->dev, ret,
"snd_soc_register_card failed\n");
return ret;
}

View File

@ -330,9 +330,8 @@ static int speyside_probe(struct platform_device *pdev)
card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
return ret;
}

View File

@ -612,8 +612,7 @@ static int tm2_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(dev, card);
if (ret < 0) {
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to register card: %d\n", ret);
dev_err_probe(dev, ret, "Failed to register card\n");
goto dai_node_put;
}

View File

@ -229,9 +229,8 @@ static int tobermory_probe(struct platform_device *pdev)
card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
return ret;
}