Re: [PATCH 1/2] ASoC: codecs: wcd938x: fix mux error handling

From: Markus Elfring
Date: Tue Apr 15 2025 - 06:01:22 EST



> +++ b/sound/soc/codecs/wcd938x.c
> @@ -3271,18 +3271,13 @@ static int wcd938x_populate_dt_data(struct wcd938x_priv *wcd938x, struct device
> return dev_err_probe(dev, wcd938x->reset_gpio,
> "Failed to get reset gpio\n");
>
> - wcd938x->us_euro_mux = devm_mux_control_get(dev, NULL);
> - if (IS_ERR(wcd938x->us_euro_mux)) {
> - if (PTR_ERR(wcd938x->us_euro_mux) == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> + if (of_property_present(dev->of_node, "mux-controls")) {
> + wcd938x->us_euro_mux = devm_mux_control_get(dev, NULL);
> + if (IS_ERR(wcd938x->us_euro_mux)) {
> + ret = PTR_ERR(wcd938x->us_euro_mux);
> + return dev_err_probe(dev, ret, "failed to get mux control\n");
> + }

May the error code assignment statement be omitted here together with extra curly brackets
(as such a case is demonstrated in a subsequent if branch)?

+ return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_mux),
+ "failed to get mux control\n");


Regards,
Markus