[PATCH v4 6/9] ASoC: samsung: midas_wm1811: Use dev_err_probe where appropriate
From: Artur Weber
Date: Sat May 25 2024 - 09:29:36 EST
Since we're already using it in the newly-added GPIO requests for
jack detection, extend it to the previous checks as well.
Signed-off-by: Artur Weber <aweber.kernel@xxxxxxxxx>
---
Changes in v4:
- Adapted to regulator get functions being dropped in favor of
SND_SOC_DAPM_REGULATOR_SUPPLY
Changes in v2:
- Added this commit
---
sound/soc/samsung/midas_wm1811.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c
index 88fa9e5bc093..ad0283364081 100644
--- a/sound/soc/samsung/midas_wm1811.c
+++ b/sound/soc/samsung/midas_wm1811.c
@@ -590,17 +590,15 @@ static int midas_probe(struct platform_device *pdev)
card->dev = dev;
priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH);
- if (IS_ERR(priv->gpio_fm_sel)) {
- dev_err(dev, "Failed to get FM selection GPIO\n");
- return PTR_ERR(priv->gpio_fm_sel);
- }
+ if (IS_ERR(priv->gpio_fm_sel))
+ return dev_err_probe(dev, PTR_ERR(priv->gpio_fm_sel),
+ "Failed to get FM selection GPIO\n");
priv->gpio_lineout_sel = devm_gpiod_get_optional(dev, "lineout-sel",
GPIOD_OUT_HIGH);
- if (IS_ERR(priv->gpio_lineout_sel)) {
- dev_err(dev, "Failed to get line out selection GPIO\n");
- return PTR_ERR(priv->gpio_lineout_sel);
- }
+ if (IS_ERR(priv->gpio_lineout_sel))
+ return dev_err_probe(dev, PTR_ERR(priv->gpio_lineout_sel),
+ "Failed to get line out selection GPIO\n");
priv->gpio_headset_detect = devm_gpiod_get_optional(dev,
"headset-detect", GPIOD_IN);
--
2.45.1