diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-09-11 10:22:48 (GMT) |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-12 13:53:09 (GMT) |
commit | 1ed3f8ce8399255c7cca43dde5d3a19b2b7dc287 (patch) | |
tree | a570cb6242abc1969934772843c5e727aefbf678 /drivers/regulator/rk808-regulator.c | |
parent | 1f0c01621aa1beb0f6bc205beeada2a4a3178d5a (diff) | |
download | linux-1ed3f8ce8399255c7cca43dde5d3a19b2b7dc287.tar.xz |
regulator: rk808: Fix missing of_node_put
1. Pass &pdev->dev rather than &client->dev to of_regulator_match, the *dev
argument is used for devres to ensure devm_of_regulator_put_matches() will
be called when unload the module.
2. of_get_child_by_name() returns a node pointer with refcount incremented.
Thus add missing of_node_put(reg_np).
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/rk808-regulator.c')
-rw-r--r-- | drivers/regulator/rk808-regulator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 9557428..07b0eb4 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -281,8 +281,9 @@ static int rk808_regulator_probe(struct platform_device *pdev) if (!reg_np) return -ENXIO; - ret = of_regulator_match(&client->dev, reg_np, rk808_reg_matches, + ret = of_regulator_match(&pdev->dev, reg_np, rk808_reg_matches, RK808_NUM_REGULATORS); + of_node_put(reg_np); if (ret < 0) return ret; |