lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2111301104440.30606@lnxricardw1.se.axis.com>
Date:   Tue, 30 Nov 2021 11:06:52 +0100
From:   Ricard Wanderlof <ricardw@...s.com>
To:     Jerome Brunet <jbrunet@...libre.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, 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.

/Ricard
-- 
Ricard Wolf Wanderlof                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ