From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Stuebner Subject: Re: [PATCH] PCI: rockchip: Properly handle optional regulators Date: Wed, 28 Aug 2019 20:15:15 +0200 Message-ID: <1801971.F4Ds6vmZ8I@phil> References: <20190828150737.30285-1-thierry.reding@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190828150737.30285-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Thierry Reding Cc: Lorenzo Pieralisi , linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Shawn Lin , Vidya Sagar , linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Bjorn Helgaas , Andrew Murray , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-rockchip.vger.kernel.org Am Mittwoch, 28. August 2019, 17:07:37 CEST schrieb Thierry Reding: > From: Thierry Reding > > regulator_get_optional() can fail for a number of reasons besides probe > deferral. It can for example return -ENOMEM if it runs out of memory as > it tries to allocate data structures. Propagating only -EPROBE_DEFER is > problematic because it results in these legitimately fatal errors being > treated as "regulator not specified in DT". > > What we really want is to ignore the optional regulators only if they > have not been specified in DT. regulator_get_optional() returns -ENODEV > in this case, so that's the special case that we need to handle. So we > propagate all errors, except -ENODEV, so that real failures will still > cause the driver to fail probe. > > Signed-off-by: Thierry Reding on a rk3399-gru-scarlet with no 12v regulator defined and pcie-wifi keeping on working with this patch: Tested-by: Heiko Stuebner Change itself also looks correct, Reviewed-by: Heiko Stuebner Thanks for doing that cleanup Heiko