From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933367AbcIFIW3 (ORCPT ); Tue, 6 Sep 2016 04:22:29 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:60124 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933304AbcIFIW0 (ORCPT ); Tue, 6 Sep 2016 04:22:26 -0400 Date: Tue, 6 Sep 2016 09:22:10 +0100 From: Mark Brown To: Felipe Balbi Cc: Stefan Agner , gregkh@linuxfoundation.org, fabio.estevam@nxp.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20160906082210.GE3950@sirena.org.uk> References: <20160904040416.22163-1-stefan@agner.ch> <87mvjlmpyo.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XyBMaHrM0hrbbr/O" Content-Disposition: inline In-Reply-To: <87mvjlmpyo.fsf@linux.intel.com> X-Cookie: FEELINGS are cascading over me!!! User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 92.40.249.119 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] usb: phy: generic: request regulator optionally X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --XyBMaHrM0hrbbr/O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 06, 2016 at 10:45:19AM +0300, Felipe Balbi wrote: > Stefan Agner 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(). --XyBMaHrM0hrbbr/O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXznyxAAoJECTWi3JdVIfQIzQH/ieiohKUcvyTKGV3UxTQIlRC evf9Agd1kncImlZyuwlSaTc/ww7hXiIpnOSW3IwBAlzSLlBahDCV7bE65vHs+eX6 1j01/Sp5OruUo64M/Xjrs9gRYzZMm7ZNkfWQrrNnoVDxKhOJwHeKyKe7B2gVXugT C0RP9JlW4zLv3hdSCQyrPAIkAdo7yyXVBIcU0gV4H0j4b6C0b/n6pQ66o1Hr0Pph L9axg74GlE1MGwz/iizCP9dDwNfq75W+CWnZqYaMLqQkGyZogAnwNc3G6v5a0jZ7 pAEaBwKV/gWPCB1kgUPF6+4mi814j5xtMZ6/fg8MA2TLMz/2Ngc79ljvm1E8TUI= =x1FL -----END PGP SIGNATURE----- --XyBMaHrM0hrbbr/O--