linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: Factor out references to rdev in regulator_force_disable()
@ 2011-05-09  9:41 Mark Brown
  2011-05-09 16:02 ` Liam Girdwood
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-05-09  9:41 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, patches, Mark Brown

Don't go looking up the rdev pointer every time, just use a local variable
like everything else.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c5b3c50..58452ac 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1508,13 +1508,14 @@ static int _regulator_force_disable(struct regulator_dev *rdev,
  */
 int regulator_force_disable(struct regulator *regulator)
 {
+	struct regulator_dev *rdev = regulator->rdev;
 	struct regulator_dev *supply_rdev = NULL;
 	int ret;
 
-	mutex_lock(&regulator->rdev->mutex);
+	mutex_lock(&rdev->mutex);
 	regulator->uA_load = 0;
-	ret = _regulator_force_disable(regulator->rdev, &supply_rdev);
-	mutex_unlock(&regulator->rdev->mutex);
+	ret = _regulator_force_disable(rdev, &supply_rdev);
+	mutex_unlock(&rdev->mutex);
 
 	if (supply_rdev)
 		regulator_disable(get_device_regulator(rdev_get_dev(supply_rdev)));
-- 
1.7.4.1


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

* Re: [PATCH] regulator: Factor out references to rdev in regulator_force_disable()
  2011-05-09  9:41 [PATCH] regulator: Factor out references to rdev in regulator_force_disable() Mark Brown
@ 2011-05-09 16:02 ` Liam Girdwood
  0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2011-05-09 16:02 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches

On Mon, 2011-05-09 at 11:41 +0200, Mark Brown wrote:
> Don't go looking up the rdev pointer every time, just use a local variable
> like everything else.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/regulator/core.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index c5b3c50..58452ac 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -1508,13 +1508,14 @@ static int _regulator_force_disable(struct regulator_dev *rdev,
>   */
>  int regulator_force_disable(struct regulator *regulator)
>  {
> +	struct regulator_dev *rdev = regulator->rdev;
>  	struct regulator_dev *supply_rdev = NULL;
>  	int ret;
>  
> -	mutex_lock(&regulator->rdev->mutex);
> +	mutex_lock(&rdev->mutex);
>  	regulator->uA_load = 0;
> -	ret = _regulator_force_disable(regulator->rdev, &supply_rdev);
> -	mutex_unlock(&regulator->rdev->mutex);
> +	ret = _regulator_force_disable(rdev, &supply_rdev);
> +	mutex_unlock(&rdev->mutex);
>  
>  	if (supply_rdev)
>  		regulator_disable(get_device_regulator(rdev_get_dev(supply_rdev)));


Applied.

Thanks

Liam


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

end of thread, other threads:[~2011-05-09 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09  9:41 [PATCH] regulator: Factor out references to rdev in regulator_force_disable() Mark Brown
2011-05-09 16:02 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).