On Tue, Nov 16, 2021 at 1:28 PM Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > On Sun, Nov 14, 2021 at 7:04 PM Hans de Goede <hdegoede@xxxxxxxxxx> 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