lkml.org 
[lkml]   [2019]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/13] cpufreq: qcom: Refactor the driver to make it easier to extend
On 05-07-19, 11:57, Niklas Cassel wrote:
> + drv->opp_tables = kcalloc(num_possible_cpus(), sizeof(*drv->opp_tables),
> + GFP_KERNEL);
> + if (!drv->opp_tables) {
> + ret = -ENOMEM;
> + goto free_drv;
> + }
>
> for_each_possible_cpu(cpu) {
> cpu_dev = get_cpu_device(cpu);
> @@ -166,19 +195,23 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
> goto free_opp;
> }
>
> - opp_tables[cpu] = dev_pm_opp_set_supported_hw(cpu_dev,
> - &versions, 1);
> - if (IS_ERR(opp_tables[cpu])) {
> - ret = PTR_ERR(opp_tables[cpu]);
> - dev_err(cpu_dev, "Failed to set supported hardware\n");
> - goto free_opp;
> + if (drv->data->get_version) {

Why depend on get_version here ? The OPP table is already allocated
unconditionally.

> + drv->opp_tables[cpu] =
> + dev_pm_opp_set_supported_hw(cpu_dev,
> + &drv->versions, 1);
> + if (IS_ERR(drv->opp_tables[cpu])) {
> + ret = PTR_ERR(drv->opp_tables[cpu]);
> + dev_err(cpu_dev,
> + "Failed to set supported hardware\n");
> + goto free_opp;
> + }
> }
> }

--
viresh

\
 
 \ /
  Last update: 2019-07-10 08:31    [W:0.273 / U:4.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site