From: Jerome Brunet <jbrunet@baylibre.com>
To: Joe Perches <joe@perches.com>, Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
linux-amlogic@lists.infradead.org
Subject: Re: [PATCH] ASoC: meson: use dev_err_probe
Date: Tue, 25 May 2021 09:25:47 +0200 [thread overview]
Message-ID: <1jh7irb7gk.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <9f21272719a3983bda647147e8460615159875b1.camel@perches.com>
On Tue 25 May 2021 at 02:07, Joe Perches <joe@perches.com> wrote:
> On Mon, 2021-05-24 at 18:51 +0200, 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.
>
> trivia:
>
> It seems that the use of %ld, PTR_ERR(<foo>) isn't particularly
> useful now as dev_err_probe already uses %pe to emit descriptive
> error messages.
Indeed. I'll update. Thx for pointing this out.
>
>
>> diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
> []
>> @@ -352,17 +352,16 @@ int axg_fifo_probe(struct platform_device *pdev)
>>
>>
>> fifo->pclk = devm_clk_get(dev, NULL);
>> if (IS_ERR(fifo->pclk)) {
>> - if (PTR_ERR(fifo->pclk) != -EPROBE_DEFER)
>> - dev_err(dev, "failed to get pclk: %ld\n",
>> - PTR_ERR(fifo->pclk));
>> + dev_err_probe(dev, PTR_ERR(fifo->pclk),
>> + "failed to get pclk: %ld\n", PTR_ERR(fifo->pclk));
>
> here.
>
>> return PTR_ERR(fifo->pclk);
>> }
>>
>>
>> fifo->arb = devm_reset_control_get_exclusive(dev, NULL);
>> if (IS_ERR(fifo->arb)) {
>> - if (PTR_ERR(fifo->arb) != -EPROBE_DEFER)
>> - dev_err(dev, "failed to get arb reset: %ld\n",
>> - PTR_ERR(fifo->arb));
>> + dev_err_probe(dev, PTR_ERR(fifo->arb),
>> + "failed to get arb reset: %ld\n",
>> + PTR_ERR(fifo->arb));
>
> etc...
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2021-05-25 7:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-24 16:51 Jerome Brunet
2021-05-25 0:07 ` Joe Perches
2021-05-25 7:25 ` Jerome Brunet [this message]
2021-11-30 9:36 Jerome Brunet
2021-11-30 10:06 ` Ricard Wanderlof
2021-11-30 10:13 ` 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=1jh7irb7gk.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=joe@perches.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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®