The patch

   regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulator

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ef541f73d1a87723a9f5bcc76669c98d20292cfa Mon Sep 17 00:00:00 2001
From: Axel Lin <axel....@ingics.com>
Date: Thu, 14 Feb 2019 09:59:56 +0800
Subject: [PATCH] regulator: stpmic1: Remove regul_id and *regmap from struct
 stpmic1_regulator

At the context with *rdev available, regulator core provides
rdev_get_id()/rdev_get_regmap() APIs to get regulator id and *regmap.
So no need to store them in struct stpmic1_regulator.

Signed-off-by: Axel Lin <axel....@ingics.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 drivers/regulator/stpmic1_regulator.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/stpmic1_regulator.c 
b/drivers/regulator/stpmic1_regulator.c
index 963e67fa9ca6..d456fb5d4044 100644
--- a/drivers/regulator/stpmic1_regulator.c
+++ b/drivers/regulator/stpmic1_regulator.c
@@ -30,20 +30,16 @@ struct stpmic1_regulator_cfg {
 
 /**
  * stpmic1 regulator data: this structure is used as driver data
- * @regul_id: regulator id
  * @reg_node: DT node of regulator (unused on non-DT platforms)
  * @cfg: stpmic specific regulator description
  * @mask_reset: mask_reset bit value
  * @irq_curlim: current limit interrupt number
- * @regmap: point to parent regmap structure
  */
 struct stpmic1_regulator {
-       unsigned int regul_id;
        struct device_node *reg_node;
        const struct stpmic1_regulator_cfg *cfg;
        u8 mask_reset;
        int irq_curlim;
-       struct regmap *regmap;
 };
 
 static int stpmic1_set_mode(struct regulator_dev *rdev, unsigned int mode);
@@ -475,9 +471,10 @@ static int stpmic1_set_mode(struct regulator_dev *rdev, 
unsigned int mode)
 static int stpmic1_set_icc(struct regulator_dev *rdev)
 {
        struct stpmic1_regulator *regul = rdev_get_drvdata(rdev);
+       struct regmap *regmap = rdev_get_regmap(rdev);
 
        /* enable switch off in case of over current */
-       return regmap_update_bits(regul->regmap, regul->cfg->icc_reg,
+       return regmap_update_bits(regmap, regul->cfg->icc_reg,
                                  regul->cfg->icc_mask, regul->cfg->icc_mask);
 }
 
@@ -501,11 +498,12 @@ static int stpmic1_regulator_init(struct platform_device 
*pdev,
                                  struct regulator_dev *rdev)
 {
        struct stpmic1_regulator *regul = rdev_get_drvdata(rdev);
+       struct regmap *regmap = rdev_get_regmap(rdev);
        int ret = 0;
 
        /* set mask reset */
        if (regul->mask_reset && regul->cfg->mask_reset_reg != 0) {
-               ret = regmap_update_bits(regul->regmap,
+               ret = regmap_update_bits(regmap,
                                         regul->cfg->mask_reset_reg,
                                         regul->cfg->mask_reset_mask,
                                         regul->cfg->mask_reset_mask);
@@ -584,10 +582,8 @@ regulator_dev *stpmic1_regulator_register(struct 
platform_device *pdev, int id,
        config.regmap = pmic_dev->regmap;
        config.driver_data = regul;
 
-       regul->regul_id = id;
        regul->reg_node = config.of_node;
        regul->cfg = &stpmic1_regulator_cfgs[id];
-       regul->regmap = pmic_dev->regmap;
 
        rdev = devm_regulator_register(&pdev->dev, &regul->cfg->desc, &config);
        if (IS_ERR(rdev)) {
-- 
2.20.1

Reply via email to