};
static struct tps65910_board *tps65910_parse_dt_reg_data(
- struct platform_device *pdev)
+ struct platform_device *pdev,
+ struct of_regulator_match **tps65910_reg_matches)
{
struct tps65910_board *pmic_plat_data;
struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent);
return NULL;
}
+ *tps65910_reg_matches = matches;
+
for (idx = 0; idx < count; idx++) {
if (!matches[idx].init_data || !matches[idx].of_node)
continue;
}
#else
static inline struct tps65910_board *tps65910_parse_dt_reg_data(
- struct platform_device *pdev)
+ struct platform_device *pdev,
+ struct of_regulator_match **tps65910_reg_matches)
{
+ *tps65910_reg_matches = NULL;
return 0;
}
#endif
struct regulator_dev *rdev;
struct tps65910_reg *pmic;
struct tps65910_board *pmic_plat_data;
+ struct of_regulator_match *tps65910_reg_matches = NULL;
int i, err;
pmic_plat_data = dev_get_platdata(tps65910->dev);
if (!pmic_plat_data && tps65910->dev->of_node)
- pmic_plat_data = tps65910_parse_dt_reg_data(pdev);
+ pmic_plat_data = tps65910_parse_dt_reg_data(pdev,
+ &tps65910_reg_matches);
if (!pmic_plat_data) {
dev_err(&pdev->dev, "Platform data not found\n");
config.driver_data = pmic;
config.regmap = tps65910->regmap;
-#ifdef CONFIG_OF
- config.of_node = of_find_node_by_name(tps65910->dev->of_node,
- info->name);
-#endif
+ if (tps65910_reg_matches)
+ config.of_node = tps65910_reg_matches[i].of_node;
rdev = regulator_register(&pmic->desc[i], &config);
if (IS_ERR(rdev)) {