regulator: hi6421: Fix getting wrong drvdata
authorAxel Lin <axel.lin@ingics.com>
Wed, 30 Jun 2021 09:59:59 +0000 (17:59 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 11 Jul 2021 22:44:37 +0000 (23:44 +0100)
commit1c73daee4bf30ccdff5e86dc400daa6f74735da5
tree6807230f281f851c987b41689c93d8149db395b5
parentea986908ccfcc53204a03bb0841227e1b26578c4
regulator: hi6421: Fix getting wrong drvdata

Since config.dev = pdev->dev.parent in current code, so
dev_get_drvdata(rdev->dev.parent) call in hi6421_regulator_enable
returns the drvdata of the mfd device rather than the regulator. Fix it.

This was broken while converting to use simplified DT parsing because the
config.dev changed from pdev->dev to pdev->dev.parent for parsing the
parent's of_node.

Fixes: 29dc269a85ef ("regulator: hi6421: Convert to use simplified DT parsing")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210630095959.2411543-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/hi6421-regulator.c