From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Henry Chen <henryc.chen@mediatek.com>,
Javier Martinez Canillas <javier@osg.samsung.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] regulator: mt6311: Trivial clean up
Date: Thu, 30 Jul 2015 21:06:43 +0800 [thread overview]
Message-ID: <1438261603.9954.2.camel@ingics.com> (raw)
Make mt6311_buck_ops, mt6311_ldo_ops and mt6311_regulators const and remove
unneeded error variable in mt6311_i2c_probe().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Sorry, just found a typo on subject line, so here is a resend.
drivers/regulator/mt6311-regulator.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/regulator/mt6311-regulator.c b/drivers/regulator/mt6311-regulator.c
index 096e620..2a5188b 100644
--- a/drivers/regulator/mt6311-regulator.c
+++ b/drivers/regulator/mt6311-regulator.c
@@ -41,7 +41,7 @@ static const struct regulator_linear_range buck_volt_range[] = {
REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV),
};
-static struct regulator_ops mt6311_buck_ops = {
+static const struct regulator_ops mt6311_buck_ops = {
.list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
@@ -52,7 +52,7 @@ static struct regulator_ops mt6311_buck_ops = {
.is_enabled = regulator_is_enabled_regmap,
};
-static struct regulator_ops mt6311_ldo_ops = {
+static const struct regulator_ops mt6311_ldo_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
@@ -91,7 +91,7 @@ static struct regulator_ops mt6311_ldo_ops = {
.enable_mask = MT6311_PMIC_RG_VBIASN_EN_MASK,\
}
-static struct regulator_desc mt6311_regulators[] = {
+static const struct regulator_desc mt6311_regulators[] = {
MT6311_BUCK(VDVFS),
MT6311_LDO(VBIASN),
};
@@ -105,15 +105,15 @@ static int mt6311_i2c_probe(struct i2c_client *i2c,
struct regulator_config config = { };
struct regulator_dev *rdev;
struct regmap *regmap;
- int error, i, ret;
+ int i, ret;
unsigned int data;
regmap = devm_regmap_init_i2c(i2c, &mt6311_regmap_config);
if (IS_ERR(regmap)) {
- error = PTR_ERR(regmap);
+ ret = PTR_ERR(regmap);
dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
- error);
- return error;
+ ret);
+ return ret;
}
ret = regmap_read(regmap, MT6311_SWCID, &data);
--
2.1.0
reply other threads:[~2015-07-30 13:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1438261603.9954.2.camel@ingics.com \
--to=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=henryc.chen@mediatek.com \
--cc=javier@osg.samsung.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome