Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eba05e4

Browse files
Andreas Kemnadegregkh
authored andcommitted
regulator: sy7636a: fix lifecycle of power good gpio
[ Upstream commit c05d0b3 ] Attach the power good gpio to the regulator device devres instead of the parent device to fix problems if probe is run multiple times (rmmod/insmod or some deferral). Fixes: 8c485be ("regulator: sy7636a: Initial commit") Signed-off-by: Andreas Kemnade <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Reviewed-by: Peng Fan <[email protected]> Message-ID: <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 069fd16 commit eba05e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/regulator/sy7636a-regulator.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
8383
if (!regmap)
8484
return -EPROBE_DEFER;
8585

86-
gdp = devm_gpiod_get(pdev->dev.parent, "epd-pwr-good", GPIOD_IN);
86+
device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
87+
88+
gdp = devm_gpiod_get(&pdev->dev, "epd-pwr-good", GPIOD_IN);
8789
if (IS_ERR(gdp)) {
88-
dev_err(pdev->dev.parent, "Power good GPIO fault %ld\n", PTR_ERR(gdp));
90+
dev_err(&pdev->dev, "Power good GPIO fault %ld\n", PTR_ERR(gdp));
8991
return PTR_ERR(gdp);
9092
}
9193

@@ -105,7 +107,6 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
105107
}
106108

107109
config.dev = &pdev->dev;
108-
config.dev->of_node = pdev->dev.parent->of_node;
109110
config.regmap = regmap;
110111

111112
rdev = devm_regulator_register(&pdev->dev, &desc, &config);

0 commit comments

Comments
 (0)