regulator: palmas: Remove *rdev[PALMAS_NUM_REGS] from struct palmas_pmic
authorAxel Lin <axel.lin@ingics.com>
Sun, 10 Mar 2019 15:06:09 +0000 (23:06 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 11 Mar 2019 16:36:04 +0000 (16:36 +0000)
This driver is using devm_regulator_register() so it is not necessary
to save *rdev for clean up. Actually the pmic->rdev[id] is not used now.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/palmas-regulator.c
include/linux/mfd/palmas.h

index 7fb9e8dd834e8118611eb6de5304e9251324f1f7..f13c7c8b10614fd7ef3e4581b0c7f9b296b9c6d3 100644 (file)
@@ -991,9 +991,6 @@ static int palmas_ldo_registration(struct palmas_pmic *pmic,
                        return PTR_ERR(rdev);
                }
 
-               /* Save regulator for cleanup */
-               pmic->rdev[id] = rdev;
-
                /* Initialise sleep/init values from platform data */
                if (pdata) {
                        reg_init = pdata->reg_init[id];
@@ -1101,9 +1098,6 @@ static int tps65917_ldo_registration(struct palmas_pmic *pmic,
                        return PTR_ERR(rdev);
                }
 
-               /* Save regulator for cleanup */
-               pmic->rdev[id] = rdev;
-
                /* Initialise sleep/init values from platform data */
                if (pdata) {
                        reg_init = pdata->reg_init[id];
@@ -1288,9 +1282,6 @@ static int palmas_smps_registration(struct palmas_pmic *pmic,
                                pdev_name);
                        return PTR_ERR(rdev);
                }
-
-               /* Save regulator for cleanup */
-               pmic->rdev[id] = rdev;
        }
 
        return 0;
@@ -1395,9 +1386,6 @@ static int tps65917_smps_registration(struct palmas_pmic *pmic,
                                pdev_name);
                        return PTR_ERR(rdev);
                }
-
-               /* Save regulator for cleanup */
-               pmic->rdev[id] = rdev;
        }
 
        return 0;
index 75e5c8ff85fcc1770305fb7eecc509eb81893d93..c34d5f0d34d79320402b51d3923486f50a8adb45 100644 (file)
@@ -553,7 +553,6 @@ struct palmas_pmic {
        struct palmas *palmas;
        struct device *dev;
        struct regulator_desc desc[PALMAS_NUM_REGS];
-       struct regulator_dev *rdev[PALMAS_NUM_REGS];
        struct mutex mutex;
 
        int smps123;