Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

regulator: tps65910: use of_node of matched regulator being register

After getting matched regulators by using of_regulator_match(),
initialize the config.of_node of regulator being register with
of_regulator_match.of_node of that regulator.
This is require for supporting regulator consumers in dt.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Laxman Dewangan and committed by
Mark Brown
84df8c12 92ab953b

+12 -7
+12 -7
drivers/regulator/tps65910-regulator.c
··· 1071 1071 }; 1072 1072 1073 1073 static struct tps65910_board *tps65910_parse_dt_reg_data( 1074 - struct platform_device *pdev) 1074 + struct platform_device *pdev, 1075 + struct of_regulator_match **tps65910_reg_matches) 1075 1076 { 1076 1077 struct tps65910_board *pmic_plat_data; 1077 1078 struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); ··· 1117 1116 return NULL; 1118 1117 } 1119 1118 1119 + *tps65910_reg_matches = matches; 1120 + 1120 1121 for (idx = 0; idx < count; idx++) { 1121 1122 if (!matches[idx].init_data || !matches[idx].of_node) 1122 1123 continue; ··· 1136 1133 } 1137 1134 #else 1138 1135 static inline struct tps65910_board *tps65910_parse_dt_reg_data( 1139 - struct platform_device *pdev) 1136 + struct platform_device *pdev, 1137 + struct of_regulator_match **tps65910_reg_matches) 1140 1138 { 1139 + *tps65910_reg_matches = NULL; 1141 1140 return 0; 1142 1141 } 1143 1142 #endif ··· 1153 1148 struct regulator_dev *rdev; 1154 1149 struct tps65910_reg *pmic; 1155 1150 struct tps65910_board *pmic_plat_data; 1151 + struct of_regulator_match *tps65910_reg_matches = NULL; 1156 1152 int i, err; 1157 1153 1158 1154 pmic_plat_data = dev_get_platdata(tps65910->dev); 1159 1155 if (!pmic_plat_data && tps65910->dev->of_node) 1160 - pmic_plat_data = tps65910_parse_dt_reg_data(pdev); 1156 + pmic_plat_data = tps65910_parse_dt_reg_data(pdev, 1157 + &tps65910_reg_matches); 1161 1158 1162 1159 if (!pmic_plat_data) { 1163 1160 dev_err(&pdev->dev, "Platform data not found\n"); ··· 1272 1265 config.driver_data = pmic; 1273 1266 config.regmap = tps65910->regmap; 1274 1267 1275 - #ifdef CONFIG_OF 1276 - config.of_node = of_find_node_by_name(tps65910->dev->of_node, 1277 - info->name); 1278 - #endif 1268 + if (tps65910_reg_matches) 1269 + config.of_node = tps65910_reg_matches[i].of_node; 1279 1270 1280 1271 rdev = regulator_register(&pmic->desc[i], &config); 1281 1272 if (IS_ERR(rdev)) {