diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-12-14 03:08:28 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-12-20 13:47:08 +0100 |
commit | 2c16636a8bbd85573376363420c8e9f6006d3753 (patch) | |
tree | 2d44f9603d97a51262d56472dbdd409e9c6ac59c /sound/soc/codecs/simple-amplifier.c | |
parent | ASoC: codecs: sgtl5000: Use dev_err_probe() helper (diff) | |
download | linux-2c16636a8bbd85573376363420c8e9f6006d3753.tar.xz linux-2c16636a8bbd85573376363420c8e9f6006d3753.zip |
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-8-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/simple-amplifier.c')
-rw-r--r-- | sound/soc/codecs/simple-amplifier.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/codecs/simple-amplifier.c b/sound/soc/codecs/simple-amplifier.c index b30fc1f894e1..d306c585b52b 100644 --- a/sound/soc/codecs/simple-amplifier.c +++ b/sound/soc/codecs/simple-amplifier.c @@ -69,7 +69,6 @@ static int simple_amp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct simple_amp *priv; - int err; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (priv == NULL) @@ -78,12 +77,9 @@ static int simple_amp_probe(struct platform_device *pdev) priv->gpiod_enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW); - if (IS_ERR(priv->gpiod_enable)) { - err = PTR_ERR(priv->gpiod_enable); - if (err != -EPROBE_DEFER) - dev_err(dev, "Failed to get 'enable' gpio: %d", err); - return err; - } + if (IS_ERR(priv->gpiod_enable)) + return dev_err_probe(dev, PTR_ERR(priv->gpiod_enable), + "Failed to get 'enable' gpio"); return devm_snd_soc_register_component(dev, &simple_amp_component_driver, |