lkml.org 
[lkml]   [2021]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ASoC: meson: use dev_err_probe
Date

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

\
 
 \ /
  Last update: 2021-11-30 11:14    [W:0.053 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site