aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8925-regulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/max8925-regulator.c')
-rw-r--r--drivers/regulator/max8925-regulator.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c
index 759510789e71..dad2bcd14e96 100644
--- a/drivers/regulator/max8925-regulator.c
+++ b/drivers/regulator/max8925-regulator.c
@@ -36,9 +36,7 @@
36 36
37struct max8925_regulator_info { 37struct max8925_regulator_info {
38 struct regulator_desc desc; 38 struct regulator_desc desc;
39 struct regulator_dev *regulator;
40 struct i2c_client *i2c; 39 struct i2c_client *i2c;
41 struct max8925_chip *chip;
42 40
43 int vol_reg; 41 int vol_reg;
44 int enable_reg; 42 int enable_reg;
@@ -251,10 +249,11 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
251{ 249{
252 struct device_node *nproot, *np; 250 struct device_node *nproot, *np;
253 int rcount; 251 int rcount;
252
254 nproot = of_node_get(pdev->dev.parent->of_node); 253 nproot = of_node_get(pdev->dev.parent->of_node);
255 if (!nproot) 254 if (!nproot)
256 return -ENODEV; 255 return -ENODEV;
257 np = of_find_node_by_name(nproot, "regulators"); 256 np = of_get_child_by_name(nproot, "regulators");
258 if (!np) { 257 if (!np) {
259 dev_err(&pdev->dev, "failed to find regulators node\n"); 258 dev_err(&pdev->dev, "failed to find regulators node\n");
260 return -ENODEV; 259 return -ENODEV;
@@ -264,7 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
264 &max8925_regulator_matches[ridx], 1); 263 &max8925_regulator_matches[ridx], 1);
265 of_node_put(np); 264 of_node_put(np);
266 if (rcount < 0) 265 if (rcount < 0)
267 return -ENODEV; 266 return rcount;
268 config->init_data = max8925_regulator_matches[ridx].init_data; 267 config->init_data = max8925_regulator_matches[ridx].init_data;
269 config->of_node = max8925_regulator_matches[ridx].of_node; 268 config->of_node = max8925_regulator_matches[ridx].of_node;
270 269
@@ -303,7 +302,6 @@ static int max8925_regulator_probe(struct platform_device *pdev)
303 return -EINVAL; 302 return -EINVAL;
304 } 303 }
305 ri->i2c = chip->i2c; 304 ri->i2c = chip->i2c;
306 ri->chip = chip;
307 305
308 config.dev = &pdev->dev; 306 config.dev = &pdev->dev;
309 config.driver_data = ri; 307 config.driver_data = ri;