Thread (49 messages) 49 messages, 6 authors, 2021-11-28

Re: [PATCH v2 17/20] extcon: intel-cht-wc: Support devs with Micro-B / USB-2 only Type-C connectors

From: Andy Shevchenko <hidden>
Date: 2021-11-16 11:34:51
Also in: linux-acpi, linux-efi, linux-i2c, lkml, platform-driver-x86

On Tue, Nov 16, 2021 at 1:28 PM Andy Shevchenko
[off-list ref] wrote:
On Sun, Nov 14, 2021 at 7:04 PM Hans de Goede [off-list ref] wrote:
...
quoted
+       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.
quoted
+       }


-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help