linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com>,
	Lee Jones <lee.jones@linaro.org>,
	Yvan FILLION <yvan.fillion@stericsson.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] regulator: ab8500-ext: Remove get_voltage to avoid duplicate implementation
Date: Sun, 07 Apr 2013 23:17:50 +0800	[thread overview]
Message-ID: <1365347870.9931.7.camel@phoenix> (raw)
In-Reply-To: <1365347548.9931.1.camel@phoenix>

The implementation of ab8500_ext_fixed_get_voltage is identical to
ab8500_ext_list_voltage. We can avoid the duplicate implementation by just
remove get_voltage. For fixed regulator, regulator core will call
list_voltage(rdev, 0) to get voltage if both get_voltage get_voltage_sel are
not implemented.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/ab8500-ext.c |   16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
index c7896af..9aee21c 100644
--- a/drivers/regulator/ab8500-ext.c
+++ b/drivers/regulator/ab8500-ext.c
@@ -237,21 +237,6 @@ static unsigned int ab8500_ext_regulator_get_mode(struct regulator_dev *rdev)
 	return ret;
 }
 
-static int ab8500_ext_fixed_get_voltage(struct regulator_dev *rdev)
-{
-	struct regulation_constraints *regu_constraints = rdev->constraints;
-
-	if (regu_constraints == NULL) {
-		dev_err(rdev_get_dev(rdev), "regulator constraints null pointer\n");
-		return -EINVAL;
-	}
-	if (regu_constraints->min_uV && regu_constraints->max_uV) {
-		if (regu_constraints->min_uV == regu_constraints->max_uV)
-			return regu_constraints->min_uV;
-	}
-	return -EINVAL;
-}
-
 static int ab8500_ext_list_voltage(struct regulator_dev *rdev,
 				   unsigned selector)
 {
@@ -275,7 +260,6 @@ static struct regulator_ops ab8500_ext_regulator_ops = {
 	.is_enabled		= ab8500_ext_regulator_is_enabled,
 	.set_mode		= ab8500_ext_regulator_set_mode,
 	.get_mode		= ab8500_ext_regulator_get_mode,
-	.get_voltage		= ab8500_ext_fixed_get_voltage,
 	.list_voltage		= ab8500_ext_list_voltage,
 };
 
-- 
1.7.10.4




  parent reply	other threads:[~2013-04-07 15:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07 15:12 [PATCH 1/4] regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info Axel Lin
2013-04-07 15:13 ` [PATCH 2/4] regulator: ab8500-ext: Get rid of is_enabled from struct ab8500_ext_regulator_info Axel Lin
2013-04-08  7:54   ` Lee Jones
2013-04-07 15:15 ` [PATCH 3/4] regulator: ab8500-ext: Remove unnecessary checking for ab9540 and ab8540 Axel Lin
2013-04-07 15:17 ` Axel Lin [this message]
2013-04-08  7:53   ` [PATCH 4/4] regulator: ab8500-ext: Remove get_voltage to avoid duplicate implementation Lee Jones
2013-04-08  7:52 ` [PATCH 1/4] regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info Lee Jones
2013-04-08 10:24 ` Mark Brown

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=1365347870.9931.7.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=bengt.g.jonsson@stericsson.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yvan.fillion@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;
as well as URLs for NNTP newsgroup(s).