From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Venu Byravarasu <vbyravarasu@nvidia.com>,
Liam Girdwood <lrg@ti.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 2/2] regulator: Remove _en_reg, _en_bit and _ops parameters from tps65090_REG macro
Date: Sat, 24 Mar 2012 10:57:53 +0800 [thread overview]
Message-ID: <1332557873.10528.2.camel@phoenix> (raw)
In-Reply-To: <1332557760.10528.0.camel@phoenix>
Both _en_bit and _ops parameters for all DCDCs and FETs are the same, so we
can hardcode it in tps65090_REG macro.
_en_reg can be calculated by _id + 12, so we can also remove it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/tps65090-regulator.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c
index 470ca7e..7baff2e 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -94,31 +94,31 @@ static struct regulator_ops tps65090_ops = {
.is_enabled = tps65090_reg_is_enabled,
};
-#define tps65090_REG(_id, _en_reg, _en_bit, _ops) \
+#define tps65090_REG(_id) \
{ \
- .reg_en_reg = _en_reg, \
- .en_bit = _en_bit, \
+ .reg_en_reg = (TPS65090_ID_##_id) + 12, \
+ .en_bit = 0, \
.id = TPS65090_ID_##_id, \
.desc = { \
.name = tps65090_rails(_id), \
.id = TPS65090_ID_##_id, \
- .ops = &_ops, \
+ .ops = &tps65090_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
}, \
}
static struct tps65090_regulator TPS65090_regulator[] = {
- tps65090_REG(DCDC1, 12, 0, tps65090_ops),
- tps65090_REG(DCDC2, 13, 0, tps65090_ops),
- tps65090_REG(DCDC3, 14, 0, tps65090_ops),
- tps65090_REG(FET1, 15, 0, tps65090_ops),
- tps65090_REG(FET2, 16, 0, tps65090_ops),
- tps65090_REG(FET3, 17, 0, tps65090_ops),
- tps65090_REG(FET4, 18, 0, tps65090_ops),
- tps65090_REG(FET5, 19, 0, tps65090_ops),
- tps65090_REG(FET6, 20, 0, tps65090_ops),
- tps65090_REG(FET7, 21, 0, tps65090_ops),
+ tps65090_REG(DCDC1),
+ tps65090_REG(DCDC2),
+ tps65090_REG(DCDC3),
+ tps65090_REG(FET1),
+ tps65090_REG(FET2),
+ tps65090_REG(FET3),
+ tps65090_REG(FET4),
+ tps65090_REG(FET5),
+ tps65090_REG(FET6),
+ tps65090_REG(FET7),
};
static inline struct tps65090_regulator *find_regulator_info(int id)
--
1.7.5.4
next prev parent reply other threads:[~2012-03-24 2:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-24 2:56 [PATCH 1/2] regulator: tps65090: Use IS_ERR to check return value of regulator_register Axel Lin
2012-03-24 2:57 ` Axel Lin [this message]
2012-03-26 6:51 ` [PATCH 2/2] regulator: Remove _en_reg, _en_bit and _ops parameters from tps65090_REG macro Venu Byravarasu
2012-03-26 3:28 ` [PATCH 1/2] regulator: tps65090: Use IS_ERR to check return value of regulator_register Venu Byravarasu
2012-03-26 10:52 ` 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=1332557873.10528.2.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=vbyravarasu@nvidia.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