From: Johan Hovold <johan@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Johan Hovold <johan+linaro@kernel.org>,
linux-sound@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Peter Rosin <peda@axentia.se>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 1/2] ASoC: codecs: wcd938x: fix mux error handling
Date: Tue, 15 Apr 2025 15:45:13 +0200 [thread overview]
Message-ID: <Z_5i6YUSGivzaOCb@hovoldconsulting.com> (raw)
In-Reply-To: <18278ed3-fef0-400d-8cba-72f4c573d7ee@web.de>
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
next prev parent reply other threads:[~2025-04-15 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 7:41 [PATCH 0/2] ASoC: codecs: wcd938x: fix mux error handling Johan Hovold
2025-04-15 7:41 ` [PATCH 1/2] " Johan Hovold
2025-04-15 10:00 ` Markus Elfring
2025-04-15 13:45 ` Johan Hovold [this message]
2025-04-15 13:57 ` [1/2] " Markus Elfring
2025-04-15 7:41 ` [PATCH 2/2] ASoC: codecs: wcd938x: drop unnecessary mux flag assignment Johan Hovold
2025-04-25 18:57 ` [PATCH 0/2] ASoC: codecs: wcd938x: fix mux error handling Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z_5i6YUSGivzaOCb@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=broonie@kernel.org \
--cc=johan+linaro@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=peda@axentia.se \
--cc=perex@perex.cz \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox