mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Ricard Wanderlof <ricardw@axis.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"linux-amlogic@lists.infradead.org"
	<linux-amlogic@lists.infradead.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: meson: use dev_err_probe
Date: Tue, 30 Nov 2021 11:13:33 +0100	[thread overview]
Message-ID: <1jmtlmeyrg.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2111301104440.30606@lnxricardw1.se.axis.com>


On Tue 30 Nov 2021 at 11:06, Ricard Wanderlof <ricardw@axis.com> wrote:

> On Tue, 30 Nov 2021, Jerome Brunet wrote:
>
>> Use dev_err_probe() helper function to handle probe deferral.
>> It removes the open coded test for -EPROBE_DEFER but more importantly, it
>> sets the deferral reason in debugfs which is great for debugging.
>> 
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>  sound/soc/meson/aiu.c               | 17 +++++++----------
>>  sound/soc/meson/axg-fifo.c          |  9 +++------
>>  sound/soc/meson/axg-pdm.c           |  9 +++------
>>  sound/soc/meson/axg-spdifin.c       |  6 ++----
>>  sound/soc/meson/axg-spdifout.c      |  6 ++----
>>  sound/soc/meson/axg-tdm-formatter.c | 18 ++++++------------
>>  sound/soc/meson/axg-tdm-interface.c |  9 +++------
>>  sound/soc/meson/meson-card-utils.c  |  4 ++--
>>  sound/soc/meson/t9015.c             |  8 ++++----
>>  9 files changed, 32 insertions(+), 54 deletions(-)
>> 
>> diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
>> index ba15d5762b0b..37036adf14ce 100644
>> --- a/sound/soc/meson/aiu.c
>> +++ b/sound/soc/meson/aiu.c
>> @@ -219,31 +219,29 @@ static int aiu_clk_get(struct device *dev)
>>  
>>          aiu->pclk = devm_clk_get(dev, "pclk");
>>          if (IS_ERR(aiu->pclk)) {
>> -               if (PTR_ERR(aiu->pclk) != -EPROBE_DEFER)
>> -                       dev_err(dev, "Can't get the aiu pclk\n");
>> +               dev_err_probe(dev, PTR_ERR(aiu->pclk),
>> +                             "Can't get the aiu pclk\n");
>>                  return PTR_ERR(aiu->pclk);
>>          }
>
> A minor thing, but dev_err_probe returns its err argument, so this 
> construct can be written more tersely as:
>
> 		return dev_err_probe(dev, PTR_ERR(aio->pclk),
>                                      "Can't get the aio pclk\n");
>
> and that also seems to be in common usage when browsing existing code.

Missed that
Thanks Ricard, I'll update the change.

>
> /Ricard

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2021-11-30 10:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  9:36 Jerome Brunet
2021-11-30 10:06 ` Ricard Wanderlof
2021-11-30 10:13   ` Jerome Brunet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-05-24 16:51 Jerome Brunet
2021-05-25  0:07 ` Joe Perches
2021-05-25  7:25   ` Jerome Brunet

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=1jmtlmeyrg.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricardw@axis.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

all inboxes | Powered by JetHome®