Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbbKBIxr (ORCPT ); Mon, 2 Nov 2015 03:53:47 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:44198 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbbKBIxd (ORCPT ); Mon, 2 Nov 2015 03:53:33 -0500 Date: Sun, 1 Nov 2015 11:29:11 +0900 From: Mark Brown To: Saurabh Sengar Cc: lgirdwood@gmail.com, linux-kernel@vger.kernel.org Message-ID: <20151101022911.GD28319@sirena.org.uk> References: <1446303691-30795-1-git-send-email-saurabh.truth@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QUHshEHhcC66g79u" Content-Disposition: inline In-Reply-To: <1446303691-30795-1-git-send-email-saurabh.truth@gmail.com> X-Cookie: "But I don't like Spam!!!!" User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: of: removing two variables min_uV and max_uV 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 Content-Length: 1678 Lines: 45 --QUHshEHhcC66g79u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 31, 2015 at 08:31:31PM +0530, Saurabh Sengar wrote: > - min_uV = of_get_property(np, "regulator-min-microvolt", NULL); > - if (min_uV) > - constraints->min_uV = be32_to_cpu(*min_uV); > + if (!of_property_read_u32(np, "regulator-max-microvolt", &pval)) > + constraints->max_uV = pval; > /* Only one voltage? Then make sure it's set. */ > - if (min_uV && max_uV && constraints->min_uV == constraints->max_uV) > + if (constraints->min_uV == constraints->max_uV) > constraints->apply_uV = true; Your new code is not equivalent to the existing code. The new code will set apply_uV even if the DT properties are not present which will in turn mean that we will end up attempting to apply a setting of 0V if that happens which is not desirable. --QUHshEHhcC66g79u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWNXj0AAoJECTWi3JdVIfQaywH/ArX/GChlyZlaXelCtYtK7cd vzE6SgcgMex4aoqfy6nTaTWyrvc8FjYM0bjpcFX/9YBtqnuqJRRTcs6BNEHEXYnt tkzHRjxXVNlaAHqteZ2dwS57tT96MgiRLrsbNOWLMKMucWhUUPXNj3s7pxyVxKn+ O/e6uE2nh+9Cxc26MU6MFbWXXqkgYTTXxqTQzNcNQn8LZLN/GMEcQrh1bKHbe3t1 +/d1cj/KrcdLW/YnDF7YKzQR1NaGIdlM5LEXragWqzNvEIwdzjGtS1T6KD1gHkHF l8y9oXTxqvQzMi0GgLAIlH9Nxwy9028oRH0FNYz90k55uDK540CIpVtQrp8YUIs= =RBS3 -----END PGP SIGNATURE----- --QUHshEHhcC66g79u-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/