Skip to content

Commit beeab9b

Browse files
krzkbroonie
authored andcommitted
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>
1 parent 378b40a commit beeab9b

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

drivers/regulator/s2mps11.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,6 @@ static const struct regulator_desc s2mpu02_regulators[] = {
11201120
static int s2mps11_pmic_probe(struct platform_device *pdev)
11211121
{
11221122
struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
1123-
struct sec_platform_data *pdata = NULL;
11241123
struct of_regulator_match *rdata = NULL;
11251124
struct regulator_config config = { };
11261125
struct s2mps11_info *s2mps11;
@@ -1171,17 +1170,6 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
11711170
if (!s2mps11->ext_control_gpiod)
11721171
return -ENOMEM;
11731172

1174-
if (!iodev->dev->of_node) {
1175-
if (iodev->pdata) {
1176-
pdata = iodev->pdata;
1177-
goto common_reg;
1178-
} else {
1179-
dev_err(pdev->dev.parent,
1180-
"Platform data or DT node not supplied\n");
1181-
return -ENODEV;
1182-
}
1183-
}
1184-
11851173
rdata = kcalloc(rdev_num, sizeof(*rdata), GFP_KERNEL);
11861174
if (!rdata)
11871175
return -ENOMEM;
@@ -1193,7 +1181,6 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
11931181
if (ret)
11941182
goto out;
11951183

1196-
common_reg:
11971184
platform_set_drvdata(pdev, s2mps11);
11981185

11991186
config.dev = &pdev->dev;
@@ -1202,13 +1189,8 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
12021189
for (i = 0; i < rdev_num; i++) {
12031190
struct regulator_dev *regulator;
12041191

1205-
if (pdata) {
1206-
config.init_data = pdata->regulators[i].initdata;
1207-
config.of_node = pdata->regulators[i].reg_node;
1208-
} else {
1209-
config.init_data = rdata[i].init_data;
1210-
config.of_node = rdata[i].of_node;
1211-
}
1192+
config.init_data = rdata[i].init_data;
1193+
config.of_node = rdata[i].of_node;
12121194
config.ena_gpiod = s2mps11->ext_control_gpiod[i];
12131195
/*
12141196
* Hand the GPIO descriptor management over to the regulator

0 commit comments

Comments
 (0)