Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 716d4016 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 1966f732 d5fb75a0
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -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);