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

regulator: s2mps11: Drop initialization via platform data

None of the platforms with S2MPS11 use board files, so any
initialization via platform data can be safely removed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210420170244.13467-5-krzysztof.kozlowski@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
beeab9bc 378b40ae

+2 -20
+2 -20
drivers/regulator/s2mps11.c
··· 1120 1120 static int s2mps11_pmic_probe(struct platform_device *pdev) 1121 1121 { 1122 1122 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); 1123 - struct sec_platform_data *pdata = NULL; 1124 1123 struct of_regulator_match *rdata = NULL; 1125 1124 struct regulator_config config = { }; 1126 1125 struct s2mps11_info *s2mps11; ··· 1170 1171 if (!s2mps11->ext_control_gpiod) 1171 1172 return -ENOMEM; 1172 1173 1173 - if (!iodev->dev->of_node) { 1174 - if (iodev->pdata) { 1175 - pdata = iodev->pdata; 1176 - goto common_reg; 1177 - } else { 1178 - dev_err(pdev->dev.parent, 1179 - "Platform data or DT node not supplied\n"); 1180 - return -ENODEV; 1181 - } 1182 - } 1183 - 1184 1174 rdata = kcalloc(rdev_num, sizeof(*rdata), GFP_KERNEL); 1185 1175 if (!rdata) 1186 1176 return -ENOMEM; ··· 1181 1193 if (ret) 1182 1194 goto out; 1183 1195 1184 - common_reg: 1185 1196 platform_set_drvdata(pdev, s2mps11); 1186 1197 1187 1198 config.dev = &pdev->dev; ··· 1189 1202 for (i = 0; i < rdev_num; i++) { 1190 1203 struct regulator_dev *regulator; 1191 1204 1192 - if (pdata) { 1193 - config.init_data = pdata->regulators[i].initdata; 1194 - config.of_node = pdata->regulators[i].reg_node; 1195 - } else { 1196 - config.init_data = rdata[i].init_data; 1197 - config.of_node = rdata[i].of_node; 1198 - } 1205 + config.init_data = rdata[i].init_data; 1206 + config.of_node = rdata[i].of_node; 1199 1207 config.ena_gpiod = s2mps11->ext_control_gpiod[i]; 1200 1208 /* 1201 1209 * Hand the GPIO descriptor management over to the regulator