regulator: palmas: Remove *rdev[PALMAS_NUM_REGS] from struct palmas_pmic
PATCH 1/1 regulator: palmas: Remove *rdev[PALMAS_NUM_REGS] from struct palmas_pmic
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 <[email protected]>
--- drivers/regulator/palmas-regulator.c | 12 ------------ include/linux/mfd/palmas.h | 1 - 2 files changed, 13 deletions(-)
drivers/regulator/palmas-regulator.c +0 -12
@@ -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 ;
include/linux/mfd/palmas.h +0 -1
@@ -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;
Signature · 1 line
2.17.1
Quoted 2 lines · Axel Lin
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.
Reviewed-by Keerthy <[email protected]>
Quoted 64 lines
Signed-off-by Axel Lin <[email protected]>--- drivers/regulator/palmas-regulator.c | 12 ------------ include/linux/mfd/palmas.h | 1 - 2 files changed, 13 deletions(-)drivers/regulator/palmas-regulator.c +0
-12@@ -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 ;include/linux/mfd/palmas.h +0
-1@@ -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;