summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-10-24 14:11:34 +0400
committerMark Brown <broonie@linaro.org>2013-10-24 14:11:34 +0400
commit3242a86170070a332037bff65ab5872189e20791 (patch)
tree341b8fc24ecc5a0b825969f15cead28942631afc /drivers/regulator
parent513b485a2d87779ddca0bfe8dc69691f62803873 (diff)
parent937433c2502f663e5a0e8804462bc38c41b9021f (diff)
downloadlinux-3242a86170070a332037bff65ab5872189e20791.tar.xz
Merge remote-tracking branch 'regulator/topic/da9210' into regulator-next
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/da9210-regulator.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
index f0fe54b38977..f7ccff14f763 100644
--- a/drivers/regulator/da9210-regulator.c
+++ b/drivers/regulator/da9210-regulator.c
@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/of_regulator.h>
#include <linux/regmap.h>
#include "da9210-regulator.h"
@@ -126,7 +127,8 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct da9210 *chip;
- struct da9210_pdata *pdata = i2c->dev.platform_data;
+ struct device *dev = &i2c->dev;
+ struct da9210_pdata *pdata = dev_get_platdata(dev);
struct regulator_dev *rdev = NULL;
struct regulator_config config = { };
int error;
@@ -147,10 +149,11 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
}
config.dev = &i2c->dev;
- if (pdata)
- config.init_data = &pdata->da9210_constraints;
+ config.init_data = pdata ? &pdata->da9210_constraints :
+ of_get_regulator_init_data(dev, dev->of_node);
config.driver_data = chip;
config.regmap = chip->regmap;
+ config.of_node = dev->of_node;
rdev = regulator_register(&da9210_reg, &config);
if (IS_ERR(rdev)) {