soc: rockchip: ipa: Fix getting error power model node

The power model node must be the child node of the device node.

Change-Id: Ib16e37c31e573f183ea304b072d2a7912e155197
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
Finley Xiao
2021-08-02 17:35:33 +08:00
parent d50861822f
commit be3327b6fb

View File

@@ -65,8 +65,8 @@ struct ipa_power_model_data *rockchip_ipa_power_model_init(struct device *dev,
if (!model_data)
return ERR_PTR(-ENOMEM);
model_node = of_find_compatible_node(dev->of_node,
NULL, "simple-power-model");
model_node = of_get_compatible_child(dev->of_node,
"simple-power-model");
if (!model_node) {
dev_err(dev, "failed to find power_model node\n");
ret = -ENODEV;
@@ -119,8 +119,11 @@ struct ipa_power_model_data *rockchip_ipa_power_model_init(struct device *dev,
cal_static_coeff:
calculate_static_coefficient(model_data);
of_node_put(model_node);
return model_data;
err:
of_node_put(model_node);
kfree(model_data);
return ERR_PTR(ret);