Commit 2c16636a authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: codecs: simple-amplifier: 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-8-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ec1e0e72
...@@ -69,7 +69,6 @@ static int simple_amp_probe(struct platform_device *pdev) ...@@ -69,7 +69,6 @@ static int simple_amp_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct simple_amp *priv; struct simple_amp *priv;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (priv == NULL) if (priv == NULL)
...@@ -78,12 +77,9 @@ static int simple_amp_probe(struct platform_device *pdev) ...@@ -78,12 +77,9 @@ static int simple_amp_probe(struct platform_device *pdev)
priv->gpiod_enable = devm_gpiod_get_optional(dev, "enable", priv->gpiod_enable = devm_gpiod_get_optional(dev, "enable",
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(priv->gpiod_enable)) { if (IS_ERR(priv->gpiod_enable))
err = PTR_ERR(priv->gpiod_enable); return dev_err_probe(dev, PTR_ERR(priv->gpiod_enable),
if (err != -EPROBE_DEFER) "Failed to get 'enable' gpio");
dev_err(dev, "Failed to get 'enable' gpio: %d", err);
return err;
}
return devm_snd_soc_register_component(dev, return devm_snd_soc_register_component(dev,
&simple_amp_component_driver, &simple_amp_component_driver,
......
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