* [PATCH] regulator: pfuze100: Remove *regulators[] from struct pfuze_chip
@ 2014-05-27 6:14 Axel Lin
0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2014-05-27 6:14 UTC (permalink / raw)
To: Mark Brown; +Cc: Robin Gong, Liam Girdwood, linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-27 6:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-27 6:14 [PATCH] regulator: pfuze100: Remove *regulators[] from struct pfuze_chip Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.