diff options
author | Axel Lin <axel.lin@ingics.com> | 2021-07-02 22:21:40 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-07-07 12:01:32 +0100 |
commit | ea986908ccfcc53204a03bb0841227e1b26578c4 (patch) | |
tree | 1202dd1b3a2945f694f5b935508202d18f3ce31d /drivers/regulator/mtk-dvfsrc-regulator.c | |
parent | c9cd752d8f3a6b13afc5332a60bea3e68f141738 (diff) | |
download | linux-ea986908ccfcc53204a03bb0841227e1b26578c4.tar.bz2 |
regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register
If use dev->parent, the regulator_unregister will not be called when this
driver is unloaded. Fix it by using dev instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210702142140.2678130-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/mtk-dvfsrc-regulator.c')
-rw-r--r-- | drivers/regulator/mtk-dvfsrc-regulator.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/regulator/mtk-dvfsrc-regulator.c b/drivers/regulator/mtk-dvfsrc-regulator.c index d3d876198d6e..234af3a66c77 100644 --- a/drivers/regulator/mtk-dvfsrc-regulator.c +++ b/drivers/regulator/mtk-dvfsrc-regulator.c @@ -179,8 +179,7 @@ static int dvfsrc_vcore_regulator_probe(struct platform_device *pdev) for (i = 0; i < regulator_init_data->size; i++) { config.dev = dev->parent; config.driver_data = (mt_regulators + i); - rdev = devm_regulator_register(dev->parent, - &(mt_regulators + i)->desc, + rdev = devm_regulator_register(dev, &(mt_regulators + i)->desc, &config); if (IS_ERR(rdev)) { dev_err(dev, "failed to register %s\n", |