提交 1ed3f8ce 编写于 作者: A Axel Lin 提交者: Mark Brown

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: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 1f0c0162
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册