summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2021-12-14 11:08:29 +0900
committerMark Brown <broonie@kernel.org>2021-12-20 12:47:09 +0000
commit17d7044715c5b1e0321f8e56060260e39bba54b7 (patch)
tree5ecab77a1a4d30d4f11ece5a23c5d924f2339acb
parent2c16636a8bbd85573376363420c8e9f6006d3753 (diff)
ASoC: codecs: simple-mux: 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-9-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/simple-mux.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/codecs/simple-mux.c b/sound/soc/codecs/simple-mux.c
index e0a09dadfa7c..d30c0d24d90a 100644
--- a/sound/soc/codecs/simple-mux.c
+++ b/sound/soc/codecs/simple-mux.c
@@ -82,7 +82,6 @@ static int simple_mux_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct simple_mux *priv;
- int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -91,12 +90,9 @@ static int simple_mux_probe(struct platform_device *pdev)
dev_set_drvdata(dev, priv);
priv->gpiod_mux = devm_gpiod_get(dev, "mux", GPIOD_OUT_LOW);
- if (IS_ERR(priv->gpiod_mux)) {
- err = PTR_ERR(priv->gpiod_mux);
- if (err != -EPROBE_DEFER)
- dev_err(dev, "Failed to get 'mux' gpio: %d", err);
- return err;
- }
+ if (IS_ERR(priv->gpiod_mux))
+ return dev_err_probe(dev, PTR_ERR(priv->gpiod_mux),
+ "Failed to get 'mux' gpio");
return devm_snd_soc_register_component(dev, &simple_mux_component_driver, NULL, 0);
}