linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: Kill s5m8767_get_reg_id function
@ 2012-01-31  7:13 Axel Lin
  2012-02-02 13:52 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-01-31  7:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown

Calling s5m8767_get_reg_id() is exactly the same as calling rdev_get_id().
It is pointless to add s5m8767_get_reg_id() function.
Use rdev_get_id() directly and remove s5m8767_get_reg_id() function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/s5m8767.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index a5b9d83..5b00e5a 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -120,16 +120,11 @@ static const struct s5m_voltage_desc *reg_voltage_map[] = {
 	[S5M8767_BUCK9] = &buck_voltage_val3,
 };
 
-static inline int s5m8767_get_reg_id(struct regulator_dev *rdev)
-{
-	return rdev_get_id(rdev);
-}
-
 static int s5m8767_list_voltage(struct regulator_dev *rdev,
 				unsigned int selector)
 {
 	const struct s5m_voltage_desc *desc;
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 	int val;
 
 	if (reg_id >= ARRAY_SIZE(reg_voltage_map) || reg_id < 0)
@@ -148,7 +143,7 @@ static int s5m8767_list_voltage(struct regulator_dev *rdev,
 
 static int s5m8767_get_register(struct regulator_dev *rdev, int *reg)
 {
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 
 	switch (reg_id) {
 	case S5M8767_LDO1 ... S5M8767_LDO2:
@@ -224,7 +219,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev)
 
 static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg)
 {
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 	int reg;
 
 	switch (reg_id) {
@@ -265,7 +260,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev *rdev)
 {
 	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
 	int reg, mask = 0xff, ret;
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 	u8 val;
 
 	ret = s5m8767_get_voltage_register(rdev, &reg);
@@ -325,7 +320,7 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
 	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
 	int min_vol = min_uV, max_vol = max_uV;
 	const struct s5m_voltage_desc *desc;
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 	int reg, mask, ret;
 	int i;
 	u8 val;
@@ -387,7 +382,7 @@ static int s5m8767_set_voltage_buck(struct regulator_dev *rdev,
 				    int min_uV, int max_uV, unsigned *selector)
 {
 	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 	const struct s5m_voltage_desc *desc;
 	int new_val, old_val, i = 0;
 	int min_vol = min_uV, max_vol = max_uV;
@@ -456,7 +451,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
 {
 	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
 	const struct s5m_voltage_desc *desc;
-	int reg_id = s5m8767_get_reg_id(rdev);
+	int reg_id = rdev_get_id(rdev);
 	int mask;
 	int new_val, old_val;
 
-- 
1.7.5.4




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

* Re: [PATCH] regulator: Kill s5m8767_get_reg_id function
  2012-01-31  7:13 [PATCH] regulator: Kill s5m8767_get_reg_id function Axel Lin
@ 2012-02-02 13:52 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-02-02 13:52 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Sangbeom Kim, Liam Girdwood

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

On Tue, Jan 31, 2012 at 03:13:31PM +0800, Axel Lin wrote:
> Calling s5m8767_get_reg_id() is exactly the same as calling rdev_get_id().
> It is pointless to add s5m8767_get_reg_id() function.
> Use rdev_get_id() directly and remove s5m8767_get_reg_id() function.

Applied, thanks.

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

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

end of thread, other threads:[~2012-02-02 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-31  7:13 [PATCH] regulator: Kill s5m8767_get_reg_id function Axel Lin
2012-02-02 13:52 ` Mark Brown

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).