Loading drivers/cpufreq/qcom-cpufreq.c +12 −20 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * MSM architecture cpufreq driver * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2015, The Linux Foundation. All rights reserved. * Copyright (c) 2007-2016, The Linux Foundation. All rights reserved. * Author: Mike A. Chan <mikechan@google.com> * * This software is licensed under the terms of the GNU General Public Loading Loading @@ -320,7 +320,7 @@ static struct cpufreq_driver msm_cpufreq_driver = { static struct cpufreq_frequency_table *cpufreq_parse_dt(struct device *dev, char *tbl_name, int cpu) { int ret, nf, i; int ret, nf, i, j; u32 *data; struct cpufreq_frequency_table *ftbl; Loading @@ -344,6 +344,7 @@ static struct cpufreq_frequency_table *cpufreq_parse_dt(struct device *dev, if (!ftbl) return ERR_PTR(-ENOMEM); j = 0; for (i = 0; i < nf; i++) { unsigned long f; Loading @@ -353,29 +354,20 @@ static struct cpufreq_frequency_table *cpufreq_parse_dt(struct device *dev, f /= 1000; /* * Check if this is the last feasible frequency in the table. * Don't repeat frequencies if they round up to the same clock * frequency. * * The table listing frequencies higher than what the HW can * support is not an error since the table might be shared * across CPUs in different speed bins. It's also not * sufficient to check if the rounded rate is lower than the * requested rate as it doesn't cover the following example: * * Table lists: 2.2 GHz and 2.5 GHz. * Rounded rate returns: 2.2 GHz and 2.3 GHz. * * In this case, we can CPUfreq to use 2.2 GHz and 2.3 GHz * instead of rejecting the 2.5 GHz table entry. */ if (i > 0 && f <= ftbl[i-1].frequency) break; if (j > 0 && f <= ftbl[j - 1].frequency) continue; ftbl[i].driver_data = i; ftbl[i].frequency = f; ftbl[j].driver_data = j; ftbl[j].frequency = f; j++; } ftbl[i].driver_data = i; ftbl[i].frequency = CPUFREQ_TABLE_END; ftbl[j].driver_data = j; ftbl[j].frequency = CPUFREQ_TABLE_END; devm_kfree(dev, data); Loading Loading
drivers/cpufreq/qcom-cpufreq.c +12 −20 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * MSM architecture cpufreq driver * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2015, The Linux Foundation. All rights reserved. * Copyright (c) 2007-2016, The Linux Foundation. All rights reserved. * Author: Mike A. Chan <mikechan@google.com> * * This software is licensed under the terms of the GNU General Public Loading Loading @@ -320,7 +320,7 @@ static struct cpufreq_driver msm_cpufreq_driver = { static struct cpufreq_frequency_table *cpufreq_parse_dt(struct device *dev, char *tbl_name, int cpu) { int ret, nf, i; int ret, nf, i, j; u32 *data; struct cpufreq_frequency_table *ftbl; Loading @@ -344,6 +344,7 @@ static struct cpufreq_frequency_table *cpufreq_parse_dt(struct device *dev, if (!ftbl) return ERR_PTR(-ENOMEM); j = 0; for (i = 0; i < nf; i++) { unsigned long f; Loading @@ -353,29 +354,20 @@ static struct cpufreq_frequency_table *cpufreq_parse_dt(struct device *dev, f /= 1000; /* * Check if this is the last feasible frequency in the table. * Don't repeat frequencies if they round up to the same clock * frequency. * * The table listing frequencies higher than what the HW can * support is not an error since the table might be shared * across CPUs in different speed bins. It's also not * sufficient to check if the rounded rate is lower than the * requested rate as it doesn't cover the following example: * * Table lists: 2.2 GHz and 2.5 GHz. * Rounded rate returns: 2.2 GHz and 2.3 GHz. * * In this case, we can CPUfreq to use 2.2 GHz and 2.3 GHz * instead of rejecting the 2.5 GHz table entry. */ if (i > 0 && f <= ftbl[i-1].frequency) break; if (j > 0 && f <= ftbl[j - 1].frequency) continue; ftbl[i].driver_data = i; ftbl[i].frequency = f; ftbl[j].driver_data = j; ftbl[j].frequency = f; j++; } ftbl[i].driver_data = i; ftbl[i].frequency = CPUFREQ_TABLE_END; ftbl[j].driver_data = j; ftbl[j].frequency = CPUFREQ_TABLE_END; devm_kfree(dev, data); Loading