Merge "PM / devfreq: memlat: simplify core-dev table parsing logic"

This commit is contained in:
qctecmdr 2019-12-18 04:07:18 -08:00 • committed by Gerrit - the friendly Code Review server
commit 716d4016ae

View file

@ -437,9 +437,6 @@ static struct core_dev_map *init_core_dev_map(struct device *dev,
struct core_dev_map *tbl;
int ret;
if (!of_node)
of_node = dev->of_node;
if (!of_find_property(of_node, prop_name, &len))
return NULL;
len /= sizeof(data);
@ -477,7 +474,7 @@ static struct memlat_node *register_common(struct device *dev,
struct memlat_hwmon *hw)
{
struct memlat_node *node;
struct device_node *of_child;
struct device_node *of_node = dev->of_node;
if (!hw->dev && !hw->of_node)
return ERR_PTR(-EINVAL);
@ -489,14 +486,11 @@ static struct memlat_node *register_common(struct device *dev,
node->ratio_ceil = 10;
node->hw = hw;
if (hw->get_child_of_node) {
of_child = hw->get_child_of_node(dev);
hw->freq_map = init_core_dev_map(dev, of_child,
"qcom,core-dev-table");
} else {
hw->freq_map = init_core_dev_map(dev, NULL,
"qcom,core-dev-table");
}
if (hw->get_child_of_node)
of_node = hw->get_child_of_node(dev);
hw->freq_map = init_core_dev_map(dev, of_node, "qcom,core-dev-table");
if (!hw->freq_map) {
dev_err(dev, "Couldn't find the core-dev freq table!\n");
return ERR_PTR(-EINVAL);