mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit"
@ 2014-06-08 11:26 Alexander Shiyan
  2014-06-08 11:26 ` [PATCH 2/2] regulator: mc13xxx: Remove unnecessary locks Alexander Shiyan
  2014-06-09 19:50 ` [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit" Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Shiyan @ 2014-06-08 11:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Alexander Shiyan

Field "hi_bit" is not used anywhere in the driver.
This patch removes this excess field.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/regulator/mc13xxx.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/regulator/mc13xxx.h b/drivers/regulator/mc13xxx.h
index 06c8903..2ab9bfd 100644
--- a/drivers/regulator/mc13xxx.h
+++ b/drivers/regulator/mc13xxx.h
@@ -21,7 +21,6 @@ struct mc13xxx_regulator {
 	int vsel_reg;
 	int vsel_shift;
 	int vsel_mask;
-	int hi_bit;
 };
 
 struct mc13xxx_regulator_priv {
-- 
1.8.5.5


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

* [PATCH 2/2] regulator: mc13xxx: Remove unnecessary locks
  2014-06-08 11:26 [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit" Alexander Shiyan
@ 2014-06-08 11:26 ` Alexander Shiyan
  2014-06-09 19:52   ` Mark Brown
  2014-06-09 19:50 ` [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit" Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Shiyan @ 2014-06-08 11:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Alexander Shiyan

Read-modify-write sequence is already protected by regmap, so no
additional locks need. This patch remove such locks from mc13xxx
regulator driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/regulator/mc13xxx-regulator-core.c | 37 +++++++-----------------------
 1 file changed, 8 insertions(+), 29 deletions(-)

diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index 05b9717..afba024 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -33,17 +33,12 @@ static int mc13xxx_regulator_enable(struct regulator_dev *rdev)
 	struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
 	struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
 	int id = rdev_get_id(rdev);
-	int ret;
 
 	dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
 
-	mc13xxx_lock(priv->mc13xxx);
-	ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
-			mc13xxx_regulators[id].enable_bit,
-			mc13xxx_regulators[id].enable_bit);
-	mc13xxx_unlock(priv->mc13xxx);
-
-	return ret;
+	return mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
+			       mc13xxx_regulators[id].enable_bit,
+			       mc13xxx_regulators[id].enable_bit);
 }
 
 static int mc13xxx_regulator_disable(struct regulator_dev *rdev)
@@ -51,16 +46,11 @@ static int mc13xxx_regulator_disable(struct regulator_dev *rdev)
 	struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
 	struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
 	int id = rdev_get_id(rdev);
-	int ret;
 
 	dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
 
-	mc13xxx_lock(priv->mc13xxx);
-	ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
-			mc13xxx_regulators[id].enable_bit, 0);
-	mc13xxx_unlock(priv->mc13xxx);
-
-	return ret;
+	return mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].reg,
+			       mc13xxx_regulators[id].enable_bit, 0);
 }
 
 static int mc13xxx_regulator_is_enabled(struct regulator_dev *rdev)
@@ -70,10 +60,7 @@ static int mc13xxx_regulator_is_enabled(struct regulator_dev *rdev)
 	int ret, id = rdev_get_id(rdev);
 	unsigned int val;
 
-	mc13xxx_lock(priv->mc13xxx);
 	ret = mc13xxx_reg_read(priv->mc13xxx, mc13xxx_regulators[id].reg, &val);
-	mc13xxx_unlock(priv->mc13xxx);
-
 	if (ret)
 		return ret;
 
@@ -86,15 +73,10 @@ static int mc13xxx_regulator_set_voltage_sel(struct regulator_dev *rdev,
 	struct mc13xxx_regulator_priv *priv = rdev_get_drvdata(rdev);
 	struct mc13xxx_regulator *mc13xxx_regulators = priv->mc13xxx_regulators;
 	int id = rdev_get_id(rdev);
-	int ret;
 
-	mc13xxx_lock(priv->mc13xxx);
-	ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].vsel_reg,
-			mc13xxx_regulators[id].vsel_mask,
-			selector << mc13xxx_regulators[id].vsel_shift);
-	mc13xxx_unlock(priv->mc13xxx);
-
-	return ret;
+	return mc13xxx_reg_rmw(priv->mc13xxx, mc13xxx_regulators[id].vsel_reg,
+			       mc13xxx_regulators[id].vsel_mask,
+			       selector << mc13xxx_regulators[id].vsel_shift);
 }
 
 static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev)
@@ -106,11 +88,8 @@ static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev)
 
 	dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
 
-	mc13xxx_lock(priv->mc13xxx);
 	ret = mc13xxx_reg_read(priv->mc13xxx,
 				mc13xxx_regulators[id].vsel_reg, &val);
-	mc13xxx_unlock(priv->mc13xxx);
-
 	if (ret)
 		return ret;
 
-- 
1.8.5.5


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

* Re: [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit"
  2014-06-08 11:26 [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit" Alexander Shiyan
  2014-06-08 11:26 ` [PATCH 2/2] regulator: mc13xxx: Remove unnecessary locks Alexander Shiyan
@ 2014-06-09 19:50 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-06-09 19:50 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-kernel, Liam Girdwood

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

On Sun, Jun 08, 2014 at 03:26:28PM +0400, Alexander Shiyan wrote:
> Field "hi_bit" is not used anywhere in the driver.
> This patch removes this excess field.

Applied, thanks.

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

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

* Re: [PATCH 2/2] regulator: mc13xxx: Remove unnecessary locks
  2014-06-08 11:26 ` [PATCH 2/2] regulator: mc13xxx: Remove unnecessary locks Alexander Shiyan
@ 2014-06-09 19:52   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-06-09 19:52 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-kernel, Liam Girdwood

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

On Sun, Jun 08, 2014 at 03:26:29PM +0400, Alexander Shiyan wrote:
> Read-modify-write sequence is already protected by regmap, so no
> additional locks need. This patch remove such locks from mc13xxx
> regulator driver.

Applied, thanks.

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

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

end of thread, other threads:[~2014-06-09 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-08 11:26 [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit" Alexander Shiyan
2014-06-08 11:26 ` [PATCH 2/2] regulator: mc13xxx: Remove unnecessary locks Alexander Shiyan
2014-06-09 19:52   ` Mark Brown
2014-06-09 19:50 ` [PATCH 1/2] regulator: mc13xxx: Remove unused field "hi_bit" Mark Brown

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

all inboxes | Powered by JetHome®