提交 8804517e 编写于 作者: J Johan Hovold 提交者: Andy Gross

soc: qcom: smsm: fix child-node lookup

Fix child-node lookup during probe, which ended up searching the whole
device tree depth-first starting at the parent rather than just matching
on its children.

Note that the original premature free of the parent node has already
been fixed separately.

Also note that this pattern of looking up the first child node with a
given property is rare enough that a generic helper is probably not
warranted.

Fixes: c97c4090 ("soc: qcom: smsm: Add driver for Qualcomm SMSM")
Fixes: 3e8b5541 ("soc: qcom: smsm: fix of_node refcnting problem")
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: NJohan Hovold <johan@kernel.org>
Reviewed-by: NBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: NAndy Gross <andy.gross@linaro.org>
上级 12aeb917
...@@ -496,8 +496,10 @@ static int qcom_smsm_probe(struct platform_device *pdev) ...@@ -496,8 +496,10 @@ static int qcom_smsm_probe(struct platform_device *pdev)
if (!smsm->hosts) if (!smsm->hosts)
return -ENOMEM; return -ENOMEM;
local_node = of_find_node_with_property(of_node_get(pdev->dev.of_node), for_each_child_of_node(pdev->dev.of_node, local_node) {
"#qcom,smem-state-cells"); if (of_find_property(local_node, "#qcom,smem-state-cells", NULL))
break;
}
if (!local_node) { if (!local_node) {
dev_err(&pdev->dev, "no state entry\n"); dev_err(&pdev->dev, "no state entry\n");
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册