lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1274105393-32197-1-git-send-email-sundar.iyer@stericsson.com>
Date:	Mon, 17 May 2010 19:39:53 +0530
From:	Sundar Iyer <sundar.iyer@...ricsson.com>
To:	<linux-kernel@...r.kernel.org>
Cc:	<STEricsson_nomadik_linux@...t.st.com>,
	Sundar R Iyer <sundar.iyer@...ricsson.com>,
	Liam Girdwood <lrg@...mlogic.co.uk>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Linus Walleij <linus.walleij@...ricsson.com>
Subject: [PATCH 1/1] regulator: return set_mode is same mode is requested

From: Sundar R Iyer <sundar.iyer@...ricsson.com>

Cc: Liam Girdwood <lrg@...mlogic.co.uk>
Cc: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Acked-by: Linus Walleij <linus.walleij@...ricsson.com>
Signed-off-by: Sundar R Iyer <sundar.iyer@...ricsson.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;
 
 	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)
-- 
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ