Don't store array of regulator_dev returned by devm_regulator_register()
in state container. It isn't used anywhere outside of
max8907_regulator_probe() function.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 drivers/regulator/max8907-regulator.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/max8907-regulator.c 
b/drivers/regulator/max8907-regulator.c
index 0c5fe6c6ac26..58959ee0249b 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -34,7 +34,6 @@
 
 struct max8907_regulator {
        struct regulator_desc desc[MAX8907_NUM_REGULATORS];
-       struct regulator_dev *rdev[MAX8907_NUM_REGULATORS];
 };
 
 #define REG_MBATT() \
@@ -311,6 +310,8 @@ static int max8907_regulator_probe(struct platform_device 
*pdev)
        }
 
        for (i = 0; i < MAX8907_NUM_REGULATORS; i++) {
+               struct regulator_dev *rdev;
+
                config.dev = pdev->dev.parent;
                if (pdata)
                        idata = pdata->init_data[i];
@@ -350,13 +351,13 @@ static int max8907_regulator_probe(struct platform_device 
*pdev)
                                pmic->desc[i].ops = &max8907_out5v_hwctl_ops;
                }
 
-               pmic->rdev[i] = devm_regulator_register(&pdev->dev,
+               rdev = devm_regulator_register(&pdev->dev,
                                                &pmic->desc[i], &config);
-               if (IS_ERR(pmic->rdev[i])) {
+               if (IS_ERR(rdev)) {
                        dev_err(&pdev->dev,
                                "failed to register %s regulator\n",
                                pmic->desc[i].name);
-                       return PTR_ERR(pmic->rdev[i]);
+                       return PTR_ERR(rdev);
                }
        }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to