diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2022-11-09 17:37:59 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-11-16 16:25:53 +0000 |
commit | 6b6ab406cedaf70f58961d4ea82e88e65e721d06 (patch) | |
tree | e19c2d221f5f4fa70a5b18670c406734042abfca /sound/soc/codecs/wsa883x.c | |
parent | 8e022387444bc5039a271fbf5a778551c4a1926b (diff) |
ASoC: codecs: wsa883x: Simplify with dev_err_probe
Code can be a bit simpler with dev_err_probe().
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221109163759.1158837-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wsa883x.c')
-rw-r--r-- | sound/soc/codecs/wsa883x.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index d40e132cd1dc..966ba4909204 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -1380,22 +1380,19 @@ static int wsa883x_probe(struct sdw_slave *pdev, return -ENOMEM; wsa883x->vdd = devm_regulator_get(dev, "vdd"); - if (IS_ERR(wsa883x->vdd)) { - dev_err(dev, "No vdd regulator found\n"); - return PTR_ERR(wsa883x->vdd); - } + if (IS_ERR(wsa883x->vdd)) + return dev_err_probe(dev, PTR_ERR(wsa883x->vdd), + "No vdd regulator found\n"); ret = regulator_enable(wsa883x->vdd); - if (ret) { - dev_err(dev, "Failed to enable vdd regulator (%d)\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to enable vdd regulator\n"); wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown", GPIOD_FLAGS_BIT_NONEXCLUSIVE | GPIOD_OUT_HIGH); if (IS_ERR(wsa883x->sd_n)) { - dev_err(&pdev->dev, "Shutdown Control GPIO not found\n"); - ret = PTR_ERR(wsa883x->sd_n); + ret = dev_err_probe(&pdev->dev, PTR_ERR(wsa883x->sd_n), + "Shutdown Control GPIO not found\n"); goto err; } @@ -1416,8 +1413,8 @@ static int wsa883x_probe(struct sdw_slave *pdev, wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config); if (IS_ERR(wsa883x->regmap)) { gpiod_direction_output(wsa883x->sd_n, 1); - dev_err(&pdev->dev, "regmap_init failed\n"); - ret = PTR_ERR(wsa883x->regmap); + ret = dev_err_probe(&pdev->dev, PTR_ERR(wsa883x->regmap), + "regmap_init failed\n"); goto err; } pm_runtime_set_autosuspend_delay(dev, 3000); |