提交 e80fb721 编写于 作者: K Krzysztof Kozlowski 提交者: Mark Brown

regulator: s5m8767: Remove regulator_dev pointer from state container

Don't store pointer to regulator_dev returned by
devm_regulator_register() in state container. It isn't used anywhere
outside of probe.
Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 c9eaa447
...@@ -28,7 +28,6 @@ struct s5m8767_info { ...@@ -28,7 +28,6 @@ struct s5m8767_info {
struct device *dev; struct device *dev;
struct sec_pmic_dev *iodev; struct sec_pmic_dev *iodev;
int num_regulators; int num_regulators;
struct regulator_dev **rdev;
struct sec_opmode_data *opmode; struct sec_opmode_data *opmode;
int ramp_delay; int ramp_delay;
...@@ -695,7 +694,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) ...@@ -695,7 +694,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
struct sec_platform_data *pdata = iodev->pdata; struct sec_platform_data *pdata = iodev->pdata;
struct regulator_config config = { }; struct regulator_config config = { };
struct regulator_dev **rdev;
struct s5m8767_info *s5m8767; struct s5m8767_info *s5m8767;
int i, ret, size, buck_init; int i, ret, size, buck_init;
...@@ -737,11 +735,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) ...@@ -737,11 +735,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
size = sizeof(struct regulator_dev *) * (S5M8767_REG_MAX - 2); size = sizeof(struct regulator_dev *) * (S5M8767_REG_MAX - 2);
s5m8767->rdev = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
if (!s5m8767->rdev)
return -ENOMEM;
rdev = s5m8767->rdev;
s5m8767->dev = &pdev->dev; s5m8767->dev = &pdev->dev;
s5m8767->iodev = iodev; s5m8767->iodev = iodev;
s5m8767->num_regulators = pdata->num_regulators; s5m8767->num_regulators = pdata->num_regulators;
...@@ -938,6 +932,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) ...@@ -938,6 +932,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
const struct sec_voltage_desc *desc; const struct sec_voltage_desc *desc;
int id = pdata->regulators[i].id; int id = pdata->regulators[i].id;
int enable_reg, enable_val; int enable_reg, enable_val;
struct regulator_dev *rdev;
desc = reg_voltage_map[id]; desc = reg_voltage_map[id];
if (desc) { if (desc) {
...@@ -969,21 +964,21 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) ...@@ -969,21 +964,21 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
s5m8767_regulator_config_ext_control(s5m8767, s5m8767_regulator_config_ext_control(s5m8767,
&pdata->regulators[i], &config); &pdata->regulators[i], &config);
rdev[i] = devm_regulator_register(&pdev->dev, &regulators[id], rdev = devm_regulator_register(&pdev->dev, &regulators[id],
&config); &config);
if (IS_ERR(rdev[i])) { if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev[i]); ret = PTR_ERR(rdev);
dev_err(s5m8767->dev, "regulator init failed for %d\n", dev_err(s5m8767->dev, "regulator init failed for %d\n",
id); id);
return ret; return ret;
} }
if (pdata->regulators[i].ext_control_gpio) { if (pdata->regulators[i].ext_control_gpio) {
ret = s5m8767_enable_ext_control(s5m8767, rdev[i]); ret = s5m8767_enable_ext_control(s5m8767, rdev);
if (ret < 0) { if (ret < 0) {
dev_err(s5m8767->dev, dev_err(s5m8767->dev,
"failed to enable gpio control over %s: %d\n", "failed to enable gpio control over %s: %d\n",
rdev[i]->desc->name, ret); rdev->desc->name, ret);
return ret; return ret;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册