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]
Date:   Thu, 5 May 2022 19:29:34 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Markuss Broks <markuss.broks@...il.com>
Cc:     pavel@....cz, Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 1/3] leds: ktd2692: Avoid duplicate error messages on
 probe deferral

On Thu, May 5, 2022 at 5:25 PM Markuss Broks <markuss.broks@...il.com> wrote:
>
> Use dev_err_probe instead of dev_err to avoid duplicate error
> messages if the GPIO allocation makes the probe defer.

Thanks!

There are two improvements we can make here.
1) adding a Fixes tag, so it can be backported to stable kernels;
2) see below.

...

>         led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);
>         ret = PTR_ERR_OR_ZERO(led->ctrl_gpio);
> -       if (ret) {
> -               dev_err(dev, "cannot get ctrl-gpios %d\n", ret);
> -               return ret;
> -       }
> +       if (ret)
> +               return dev_err_probe(dev, ret, "cannot get ctrl-gpios\n");

You may improve this and simultaneously prepare for the next change to
be smaller

       led->ctrl_gpio = devm_gpiod_get(dev, "ctrl", GPIOD_ASIS);
       if (IS_ERR(led->ctrl_gpio))
               return dev_err_probe(dev, PTR_ERR(led->ctrl_gpio),
"cannot get ctrl-gpios\n");

All the same for the other case.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ