mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
Merge "PM / devfreq: memlat: simplify core-dev table parsing logic"
This commit is contained in:
commit
716d4016ae
1 changed files with 6 additions and 12 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue