[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1jmtlmeyrg.fsf@starbuckisacylon.baylibre.com>
Date: Tue, 30 Nov 2021 11:13:33 +0100
From: Jerome Brunet <jbrunet@...libre.com>
To: Ricard Wanderlof <ricardw@...s.com>
Cc: Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
"linux-amlogic@...ts.infradead.org"
<linux-amlogic@...ts.infradead.org>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ASoC: meson: use dev_err_probe
On Tue 30 Nov 2021 at 11:06, Ricard Wanderlof <ricardw@...s.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@...libre.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
Powered by blists - more mailing lists