From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Sundar Iyer <sundar.iyer@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
STEricsson_nomadik_linux@list.st.com,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH 1/1] regulator: return set_mode is same mode is requested
Date: Mon, 17 May 2010 15:35:29 +0100 [thread overview]
Message-ID: <1274106929.3185.5.camel@odin> (raw)
In-Reply-To: <1274105393-32197-1-git-send-email-sundar.iyer@stericsson.com>
On Mon, 2010-05-17 at 19:39 +0530, Sundar Iyer wrote:
> From: Sundar R Iyer <sundar.iyer@stericsson.com>
>
> Cc: Liam Girdwood <lrg@slimlogic.co.uk>
> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Acked-by: Linus Walleij <linus.walleij@stericsson.com>
> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
> ---
> drivers/regulator/core.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index 98e5d14..5054add 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -1599,6 +1599,7 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
> {
> struct regulator_dev *rdev = regulator->rdev;
> int ret;
> + int regulator_curr_mode;
Shouldn't this variable be in regulator_set_mode() ?
>
> mutex_lock(&rdev->mutex);
>
> @@ -1754,6 +1755,13 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode)
> goto out;
> }
>
> + /* return if the same mode is requested */
> + regulator_curr_mode = rdev->desc->ops->get_mode(rdev);
> + if (regulator_curr_mode == mode) {
> + ret = 0;
> + goto out;
> + }
> +
> /* constraints check */
> ret = regulator_check_mode(rdev, mode);
> if (ret < 0)
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
next prev parent reply other threads:[~2010-05-17 14:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-17 14:09 [PATCH 1/1] regulator: return set_mode is same mode is requested Sundar Iyer
2010-05-17 14:35 ` Liam Girdwood [this message]
2010-05-17 14:44 ` Mark Brown
2010-05-17 14:56 ` Sundar R Iyer
2010-05-17 15:15 ` Sundar R Iyer
2010-05-17 15:34 ` Mark Brown
2010-05-17 15:54 ` Sundar R Iyer
2010-05-17 16:08 ` Mark Brown
2010-05-17 19:44 ` Liam Girdwood
2010-05-17 15:18 ` Sundar R Iyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274106929.3185.5.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=STEricsson_nomadik_linux@list.st.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sundar.iyer@stericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox