Skip to contentSkip to conversation

regulator: pfuze100: Remove *regulators[] from struct pfuze_chip

PATCH New Axel Lin 1 participant 1 message May 27, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: pfuze100: Remove *regulators[] from struct pfuze_chip

This driver is using devm_regulator_register() so we don't need to save the pointer for cleanup.

---
 drivers/regulator/pfuze100-regulator.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/regulator/pfuze100-regulator.c +4 -5
index 930eb13..c12cbdf32 100644
@@ -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);
 		}
 	}
 
Signature · 1 line
1.8.3.2