regulator: bd718x7: Stop using parent data
PATCH 1/1 regulator: bd718x7: Stop using parent data
The ROHM PMIC regulator drivers only need the regmap pointer from the parent device. Regmap can be obtained via dev_get_regmap() so do not require parent to populate driver data for that.
---
Sorry for not including this in previous cleanup patch I sent yesterday.
This is last user for MFD struct struct bd718xx - so I thought of sending this together with the MFD change - and the MFD change was still partially unfinished. Well, I just noticed the MFD can't be applied before the clk portion (which I already sent) is applied - so I must anyways wait for the clk before sending the MFD. Well, I guess I can send out the regulator bits as well as I now anyways need to manally poll the clk to be applied before sending the MFD.
drivers/regulator/bd718x7-regulator.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/regulator/bd718x7-regulator.c +9 -11
@@ -1349,7 +1349,7 @@ static int get_hw_controlled_regulators(struct device *dev,static int bd718xx_probe (struct platform_device *pdev) { -struct bd718xx *mfd; +struct regmap *regmap;struct regulator_config config = {0 };int i, j, err, omit_enable;bool use_snvs;
@@ -1358,11 +1358,10 @@ static int bd718xx_probe(struct platform_device *pdev)enum rohm_chip_type chip =platform_get_device_id (pdev)->driver_data;const struct regulator_ops **swops, **hwops; - mfd =dev_get_drvdata (pdev->dev.parent); -if (!mfd) { + regmap =dev_get_regmap (pdev->dev.parent,NULL ); +if (!regmap) {dev_err (&pdev->dev,"No MFD driver data\n" ); - err = -EINVAL ; - goto err; +return -EINVAL ; }switch (chip) {
@@ -1385,7 +1384,7 @@ static int bd718xx_probe(struct platform_device *pdev) }/* Register LOCK release */ - err =regmap_update_bits (mfd->chip.regmap,BD718XX_REG_REGLOCK , + err =regmap_update_bits (regmap,BD718XX_REG_REGLOCK , (REGLOCK_PWRSEQ |REGLOCK_VREG ),0 );if (err) {dev_err (&pdev->dev,"Failed to unlock PMIC (%d)\n" , err);
@@ -1404,8 +1403,7 @@ static int bd718xx_probe(struct platform_device *pdev)* bit allowing HW defaults for power rails to be used */ if (!use_snvs) { - err = regmap_update_bits(mfd->chip.regmap, - BD718XX_REG_TRANS_COND1, + err = regmap_update_bits(regmap, BD718XX_REG_TRANS_COND1, BD718XX_ON_REQ_POWEROFF_MASK | BD718XX_SWRESET_POWEROFF_MASK | BD718XX_WDOG_POWEROFF_MASK |
@@ -1421,7 +1419,7 @@ static int bd718xx_probe(struct platform_device *pdev) } config.dev = pdev->dev.parent; - config.regmap = mfd->chip.regmap; + config.regmap = regmap;/* * There are cases when we want to leave the enable-control for * the HW state machine and use this driver only for voltage control.
@@ -1478,7 +1476,7 @@ static int bd718xx_probe(struct platform_device *pdev)if (!no_enable_control && (!use_snvs || !rdev->constraints->always_on || !rdev->constraints->boot_on)) { - err =regmap_update_bits (mfd->chip.regmap, r->init.reg, + err =regmap_update_bits (regmap, r->init.reg, r->init.mask, r->init.val);if (err) { dev_err(&pdev->dev,
@@ -1488,7 +1486,7 @@ static int bd718xx_probe(struct platform_device *pdev) } }for (j =0 ; j < r->additional_init_amnt; j++) { - err =regmap_update_bits (mfd->chip.regmap, + err =regmap_update_bits (regmap, r->additional_inits[j].reg, r->additional_inits[j].mask, r->additional_inits[j].val);
base-commit: 2c85ebc57b3e1817b6ce1a6b703928e113a90442
Signature · 14 lines
2.25.4 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =]
Mark Brown
maintainerQuoted 3 lines · Matti Vaittinen
The ROHM PMIC regulator drivers only need the regmap pointer from the parent device. Regmap can be obtained via
dev_get_regmap()so do not require parent to populate driver data for that.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/1] regulator: bd718x7: Stop using parent data
commit: 907dfdc945aa3d183cdc6a81b963ee3b42ece306
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