All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table
@ 2012-07-06 11:14 Axel Lin
  2012-07-06 11:15 ` [PATCH 2/2] regulator: aat2870: Remove unused min_uV and max_uV from struct aat2870_regulator Axel Lin
  2012-07-12 17:27 ` [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-07-06 11:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Jin Park, Liam Girdwood, linux-kernel

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/aat2870-regulator.c |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 06776ca..6644e83 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -33,8 +33,6 @@ struct aat2870_regulator {
 	struct aat2870_data *aat2870;
 	struct regulator_desc desc;
 
-	const int *voltages; /* uV */
-
 	int min_uV;
 	int max_uV;
 
@@ -47,14 +45,6 @@ struct aat2870_regulator {
 	u8 voltage_mask;
 };
 
-static int aat2870_ldo_list_voltage(struct regulator_dev *rdev,
-				    unsigned selector)
-{
-	struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
-
-	return ri->voltages[selector];
-}
-
 static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev,
 				       unsigned selector)
 {
@@ -111,7 +101,7 @@ static int aat2870_ldo_is_enabled(struct regulator_dev *rdev)
 }
 
 static struct regulator_ops aat2870_ldo_ops = {
-	.list_voltage = aat2870_ldo_list_voltage,
+	.list_voltage = regulator_list_voltage_table,
 	.set_voltage_sel = aat2870_ldo_set_voltage_sel,
 	.get_voltage_sel = aat2870_ldo_get_voltage_sel,
 	.enable = aat2870_ldo_enable,
@@ -119,7 +109,7 @@ static struct regulator_ops aat2870_ldo_ops = {
 	.is_enabled = aat2870_ldo_is_enabled,
 };
 
-static const int aat2870_ldo_voltages[] = {
+static const unsigned int aat2870_ldo_voltages[] = {
 	1200000, 1300000, 1500000, 1600000,
 	1800000, 2000000, 2200000, 2500000,
 	2600000, 2700000, 2800000, 2900000,
@@ -132,11 +122,11 @@ static const int aat2870_ldo_voltages[] = {
 			.name = #ids,			\
 			.id = AAT2870_ID_##ids,		\
 			.n_voltages = ARRAY_SIZE(aat2870_ldo_voltages),	\
+			.volt_table = aat2870_ldo_voltages, \
 			.ops = &aat2870_ldo_ops,	\
 			.type = REGULATOR_VOLTAGE,	\
 			.owner = THIS_MODULE,		\
 		},					\
-		.voltages = aat2870_ldo_voltages,	\
 		.min_uV = 1200000,			\
 		.max_uV = 3300000,			\
 	}
-- 
1.7.9.5




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

* [PATCH 2/2] regulator: aat2870: Remove unused min_uV and max_uV from struct aat2870_regulator
  2012-07-06 11:14 [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table Axel Lin
@ 2012-07-06 11:15 ` Axel Lin
  2012-07-12 17:27 ` [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2012-07-06 11:15 UTC (permalink / raw)
  To: Mark Brown; +Cc: Jin Park, Liam Girdwood, linux-kernel

Both min_uV and max_uV are not used in the code, remove them.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/aat2870-regulator.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 6644e83..6f45bfd 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -33,9 +33,6 @@ struct aat2870_regulator {
 	struct aat2870_data *aat2870;
 	struct regulator_desc desc;
 
-	int min_uV;
-	int max_uV;
-
 	u8 enable_addr;
 	u8 enable_shift;
 	u8 enable_mask;
@@ -127,8 +124,6 @@ static const unsigned int aat2870_ldo_voltages[] = {
 			.type = REGULATOR_VOLTAGE,	\
 			.owner = THIS_MODULE,		\
 		},					\
-		.min_uV = 1200000,			\
-		.max_uV = 3300000,			\
 	}
 
 static struct aat2870_regulator aat2870_regulators[] = {
-- 
1.7.9.5




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

* Re: [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table
  2012-07-06 11:14 [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table Axel Lin
  2012-07-06 11:15 ` [PATCH 2/2] regulator: aat2870: Remove unused min_uV and max_uV from struct aat2870_regulator Axel Lin
@ 2012-07-12 17:27 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-07-12 17:27 UTC (permalink / raw)
  To: Axel Lin; +Cc: Jin Park, Liam Girdwood, linux-kernel

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

On Fri, Jul 06, 2012 at 07:14:32PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied both, 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:[~2012-07-12 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-06 11:14 [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table Axel Lin
2012-07-06 11:15 ` [PATCH 2/2] regulator: aat2870: Remove unused min_uV and max_uV from struct aat2870_regulator Axel Lin
2012-07-12 17:27 ` [PATCH 1/2] regulator: aat2870: Convert to regulator_list_voltage_table Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.