public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: fixed: fix regulator_list_voltage() for regression
@ 2013-11-13 11:33 Guennadi Liakhovetski
  2013-11-13 11:38 ` Laxman Dewangan
  2013-11-13 14:02 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2013-11-13 11:33 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Laxman Dewangan

Commit c368e5fc2a190923b786f2de3e79430ea3566a25 "regulator: fixed:
get rid of {get|list}_voltage()" broke regulator_list_voltage() for
the fixed regulator, because an earlier commit
5a523605afa7d3b54b2e7041f8c9e6bc39872a7e "regulator: core: provide
fixed voltage in desc for single voltage rail" missed to add support
for the fixed-voltage special case to that function. This patch
fixes that regression.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/regulator/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6382f0a..3fe1313 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2184,6 +2184,9 @@ int regulator_list_voltage(struct regulator *regulator, unsigned selector)
 	struct regulator_ops	*ops = rdev->desc->ops;
 	int			ret;
 
+	if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1 && !selector)
+		return rdev->desc->fixed_uV;
+
 	if (!ops->list_voltage || selector >= rdev->desc->n_voltages)
 		return -EINVAL;
 
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: fixed: fix regulator_list_voltage() for regression
  2013-11-13 11:33 [PATCH] regulator: fixed: fix regulator_list_voltage() for regression Guennadi Liakhovetski
@ 2013-11-13 11:38 ` Laxman Dewangan
  2013-11-13 14:02 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Laxman Dewangan @ 2013-11-13 11:38 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Mark Brown, linux-kernel@vger.kernel.org

On Wednesday 13 November 2013 05:03 PM, Guennadi Liakhovetski wrote:
> Commit c368e5fc2a190923b786f2de3e79430ea3566a25 "regulator: fixed:
> get rid of {get|list}_voltage()" broke regulator_list_voltage() for
> the fixed regulator, because an earlier commit
> 5a523605afa7d3b54b2e7041f8c9e6bc39872a7e "regulator: core: provide
> fixed voltage in desc for single voltage rail" missed to add support
> for the fixed-voltage special case to that function. This patch
> fixes that regression.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---

I tested the regulator_get_voltage() API only, not other APIs which uses 
regulator_list_voltage().
I think this patch is fine.

Acked-by: Laxman Dewangan <ldewangan@nvidia.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: fixed: fix regulator_list_voltage() for regression
  2013-11-13 11:33 [PATCH] regulator: fixed: fix regulator_list_voltage() for regression Guennadi Liakhovetski
  2013-11-13 11:38 ` Laxman Dewangan
@ 2013-11-13 14:02 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-11-13 14:02 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-kernel, Laxman Dewangan

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

On Wed, Nov 13, 2013 at 12:33:00PM +0100, Guennadi Liakhovetski wrote:
> Commit c368e5fc2a190923b786f2de3e79430ea3566a25 "regulator: fixed:
> get rid of {get|list}_voltage()" broke regulator_list_voltage() for
> the fixed regulator, because an earlier commit

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-13 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 11:33 [PATCH] regulator: fixed: fix regulator_list_voltage() for regression Guennadi Liakhovetski
2013-11-13 11:38 ` Laxman Dewangan
2013-11-13 14:02 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox