[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_5i6YUSGivzaOCb@hovoldconsulting.com>
Date: Tue, 15 Apr 2025 15:45:13 +0200
From: Johan Hovold <johan@...nel.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Johan Hovold <johan+linaro@...nel.org>, linux-sound@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Jaroslav Kysela <perex@...ex.cz>, Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>, Peter Rosin <peda@...ntia.se>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Takashi Iwai <tiwai@...e.com>
Subject: Re: [PATCH 1/2] ASoC: codecs: wcd938x: fix mux error handling
On Tue, Apr 15, 2025 at 12:00:33PM +0200, Markus Elfring wrote:
> …
> > +++ 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)?
I considered that, but I prefer using a temporary variable as it is more
readable.
>
> + return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_mux),
> + "failed to get mux control\n");
Johan
Powered by blists - more mailing lists