[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160906082210.GE3950@sirena.org.uk>
Date: Tue, 6 Sep 2016 09:22:10 +0100
From: Mark Brown <broonie@...nel.org>
To: Felipe Balbi <balbi@...nel.org>
Cc: Stefan Agner <stefan@...er.ch>, gregkh@...uxfoundation.org,
fabio.estevam@....com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: phy: generic: request regulator optionally
On Tue, Sep 06, 2016 at 10:45:19AM +0300, Felipe Balbi wrote:
> Stefan Agner <stefan@...er.ch> writes:
> > According to the device tree bindings the vcc-supply is optional.
This is nonsense unless the device can work without this supply. Given
that the supply is called VCC that doesn't seem entirely likely.
> > + nop->vcc = devm_regulator_get_optional(dev, "vcc");
> > if (IS_ERR(nop->vcc)) {
> > dev_dbg(dev, "Error getting vcc regulator: %ld\n",
> > PTR_ERR(nop->vcc));
> > - if (needs_vcc)
> > - return -EPROBE_DEFER;
> > + if (needs_vcc || PTR_ERR(nop->vcc) == -EPROBE_DEFER)
> > + return PTR_ERR(nop->vcc);
> does this look okay from a regulator API perspective?
That's how to use _get_optional() but it's really unusual that you
should be using _get_optional().
Download attachment "signature.asc" of type "application/pgp-signature" (456 bytes)
Powered by blists - more mailing lists