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: <CAHp75VfSwf0SKDHDOG7WO9xY5Q52o1Zw2GPkxi7UnrLhMtiobA@mail.gmail.com>
Date:   Tue, 16 Nov 2021 13:31:05 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Hans de Goede <hdegoede@...hat.com>
Cc:     "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Mark Gross <markgross@...nel.org>,
        Andy Shevchenko <andy@...radead.org>,
        Wolfram Sang <wsa@...-dreams.de>,
        Sebastian Reichel <sre@...nel.org>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Ard Biesheuvel <ardb@...nel.org>, Len Brown <lenb@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Yauhen Kharuzhy <jekhor@...il.com>,
        Tsuchiya Yuto <kitakar@...il.com>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        linux-i2c <linux-i2c@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-efi <linux-efi@...r.kernel.org>
Subject: Re: [PATCH v2 17/20] extcon: intel-cht-wc: Support devs with Micro-B
 / USB-2 only Type-C connectors

On Tue, Nov 16, 2021 at 1:28 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Sun, Nov 14, 2021 at 7:04 PM Hans de Goede <hdegoede@...hat.com> wrote:

...

> > +       ext->vbus_boost = devm_regulator_get_optional(ext->dev, "vbus");
> > +       if (IS_ERR(ext->vbus_boost)) {
> > +               ret = PTR_ERR(ext->vbus_boost);
> > +               if (ret == -ENODEV)
> > +                       ret = -EPROBE_DEFER;
> > +
> > +               return dev_err_probe(ext->dev, ret, "getting vbus regulator");
>
> Can be also written as
>
>     if (PTR_ERR(ext->vbus_boost) == -ENODEV ||
> PTR_ERR(ext->vbus_boost) == -EPROBE_DEFER)
>         return dev_err_probe(ext->dev, -EPROBE_DEFER, "getting vbus regulator");
>
>     return PTR_ERR(ext->vbus_boost);

Oops, other way around, of course.

  if (PTR_ERR(ext->vbus_boost) == -ENODEV ||
      PTR_ERR(ext->vbus_boost) == -EPROBE_DEFER)
        return -EPROBE_DEFER;

  return dev_err_probe(ext->dev, PTR_ERR(ext->vbus_boost), "getting
vbus regulator");

> but up to you.
>
> > +       }



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ