From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Robin Gong <b38343@freescale.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: pfuze100: Remove *regulators[] from struct pfuze_chip
Date: Tue, 27 May 2014 14:14:06 +0800 [thread overview]
Message-ID: <1401171246.11231.5.camel@phoenix> (raw)
This driver is using devm_regulator_register() so we don't need to save the
pointer for cleanup.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/pfuze100-regulator.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index 930eb13..c12cbdf32 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -69,7 +69,6 @@ struct pfuze_chip {
struct regmap *regmap;
struct device *dev;
struct pfuze_regulator regulator_descs[PFUZE100_MAX_REGULATOR];
- struct regulator_dev *regulators[PFUZE100_MAX_REGULATOR];
};
static const int pfuze100_swbst[] = {
@@ -411,6 +410,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
struct pfuze_regulator_platform_data *pdata =
dev_get_platdata(&client->dev);
struct regulator_config config = { };
+ struct regulator_dev *rdev;
int i, ret;
const struct of_device_id *match;
u32 regulator_num;
@@ -508,12 +508,11 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
config.of_node = match_of_node(i);
config.ena_gpio = -EINVAL;
- pfuze_chip->regulators[i] =
- devm_regulator_register(&client->dev, desc, &config);
- if (IS_ERR(pfuze_chip->regulators[i])) {
+ rdev = devm_regulator_register(&client->dev, desc, &config);
+ if (IS_ERR(rdev)) {
dev_err(&client->dev, "register regulator%s failed\n",
pfuze_regulators[i].desc.name);
- return PTR_ERR(pfuze_chip->regulators[i]);
+ return PTR_ERR(rdev);
}
}
--
1.8.3.2
reply other threads:[~2014-05-27 6:14 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=1401171246.11231.5.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=b38343@freescale.com \
--cc=broonie@kernel.org \
--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