From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbcBPB4n (ORCPT ); Mon, 15 Feb 2016 20:56:43 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:53217 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751892AbcBPB4m (ORCPT ); Mon, 15 Feb 2016 20:56:42 -0500 Date: Tue, 16 Feb 2016 01:56:16 +0000 From: Mark Brown To: Viresh Kumar Cc: Arnd Bergmann , linaro-kernel@lists.linaro.org, Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd , Jon Hunter , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Message-ID: <20160216015616.GH18327@sirena.org.uk> References: <1455544758-7718-1-git-send-email-jonathanh@nvidia.com> <743509d913cbc0e725bea52281be03b009e02bb5.1455553501.git.viresh.kumar@linaro.org> <17646703.2nZXD4icYj@wuerfel> <20160216010059.GH6334@vireshk-i7> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CEUtFxTsmBsHRLs3" Content-Disposition: inline In-Reply-To: <20160216010059.GH6334@vireshk-i7> X-Cookie: Adapt. Enjoy. Survive. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 165.120.89.81 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] PM / OPP: Initialize regulator pointer to an error value X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --CEUtFxTsmBsHRLs3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 16, 2016 at 06:30:59AM +0530, Viresh Kumar wrote: > - And so I left the regulator pointer to NULL in OPP core. > - But then I realized that its not safe to call many regulator core > APIs with NULL regulator, as those caused the crashes reported by > multiple people now. > - clk APIs guarantee that they return early when NULL clk is passed to > them. > - Do we need to do the same for regulator core as well ? No, NULL is explicitly not something you can substitute in, essentially all the users are just not bothering to implement error checking and we don't want to encourage that. The set of use cases where we legitimately have optional supplies is very small, much smaller than clocks, because it makes the electrical engineering a lot harder. --CEUtFxTsmBsHRLs3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWwoG/AAoJECTWi3JdVIfQa+cH/jRzO97INSqEf0+rYcLc/TPI HqUkp+lqmo5dswDTRLtIhajxRL4K23uKP8Q7rxLlystsmOSjiavUs3LIcfjNkx97 /JdH3z4LwaVsUIZifb/C3q5PB6dyoqUaS9fqit06u6iGXoUAv93jtfAtrkKkiAbG mKNvEI32c8nAbi0BSpv5c5Pw2tVVmEikI3l2EgQarkwOt+18KQZqC3ugo2kgHKgE 63ZDD10TIuDme1gYwvH+xfJ6fuhs4ptGWjYztxr1oaoYUjW0tS6i+lrPtVlKGVm9 HzIHPVjWHB0B8ql76jCChqqUUEU8A63lmyveiFPrYi073ZjJDbpL62odvvo8WuQ= =bYWH -----END PGP SIGNATURE----- --CEUtFxTsmBsHRLs3--