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

Commit 690a9995 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: msm: Fix a bug in the derive_device_list api"

parents 5bb717a3 943b84a8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1071,6 +1071,7 @@ static struct device **derive_device_list(struct clk *clk,
		return ERR_PTR(-ENOMEM);

	for (j = 0; j < count; j++) {
		device_list[j] = NULL;
		dev_node = of_parse_phandle(np, clk_handle_name, j);
		if (!dev_node) {
			pr_err("Unable to get device_node pointer for %s opp-handle (%s)\n",
@@ -1081,10 +1082,12 @@ static struct device **derive_device_list(struct clk *clk,
		for_each_possible_cpu(cpu) {
			if (of_get_cpu_node(cpu, NULL) == dev_node) {
				device_list[j] = get_cpu_device(cpu);
				continue;
			}
		}

		if (device_list[j])
			continue;

		pdev = of_find_device_by_node(dev_node);
		if (!pdev) {
			pr_err("Unable to find platform_device node for %s opp-handle\n",
@@ -1181,7 +1184,7 @@ static void populate_clock_opp_table(struct device_node *np,

		store_vcorner = false;
		clk = table[i].clk;
		if (!clk || !clk->num_fmax)
		if (!clk || !clk->num_fmax || clk->opp_table_populated)
			continue;

		if (strlen(clk->dbg_name) + LEN_OPP_HANDLE
@@ -1276,6 +1279,9 @@ static void populate_clock_opp_table(struct device_node *np,
			n++;
		}
err_round_rate:
		/* If OPP table population was successful, set the flag */
		if (uv >= 0 && ret >= 0)
			clk->opp_table_populated = true;
		kfree(device_list);
	}
}
+2 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ struct clk_ops {
 * @vdd_class: voltage scaling requirement class
 * @fmax: maximum frequency in Hz supported at each voltage level
 * @parent: the current source of this clock
 * @opp_table_populated: tracks if the OPP table of this clock has been filled
 */
struct clk {
	uint32_t flags;
@@ -193,6 +194,7 @@ struct clk {

	unsigned long init_rate;
	bool always_on;
	bool opp_table_populated;

	struct dentry *clk_dir;
};