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

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

Merge "mmc: core: fix the pointer cast of freq_table" into msm-4.9

parents 6138a33d f3218eb3
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -617,12 +617,25 @@ static int mmc_devfreq_create_freq_table(struct mmc_host *host)
	}

out:
	clk_scaling->devfreq_profile.freq_table = (unsigned long *)clk_scaling->freq_table;
	/**
	 * devfreq requires unsigned long type freq_table while the
	 * freq_table in clk_scaling is un32. Here allocates an individual
	 * memory space for it and release it when exit clock scaling.
	 */
	clk_scaling->devfreq_profile.freq_table =  kzalloc(
			clk_scaling->freq_table_sz *
			sizeof(*(clk_scaling->devfreq_profile.freq_table)),
			GFP_KERNEL);
	if (!clk_scaling->devfreq_profile.freq_table)
		return -ENOMEM;
	clk_scaling->devfreq_profile.max_state = clk_scaling->freq_table_sz;

	for (i = 0; i < clk_scaling->freq_table_sz; i++)
	for (i = 0; i < clk_scaling->freq_table_sz; i++) {
		clk_scaling->devfreq_profile.freq_table[i] =
			clk_scaling->freq_table[i];
		pr_debug("%s: freq[%d] = %u\n",
			mmc_hostname(host), i, clk_scaling->freq_table[i]);
	}

	return 0;
}
@@ -858,6 +871,8 @@ int mmc_exit_clk_scaling(struct mmc_host *host)
		return err;
	}

	kfree(host->clk_scaling.devfreq_profile.freq_table);

	host->clk_scaling.devfreq = NULL;
	atomic_set(&host->clk_scaling.devfreq_abort, 1);
	pr_debug("%s: devfreq was removed\n", mmc_hostname(host));