Skip to content

Commit

Permalink
OPP: Use consistent names for OPP table instances
Browse files Browse the repository at this point in the history
The OPP table is called "opp_table" at most of the places and "table" at
few. Make all of them follow the same naming convention, "opp_table".

Tested-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
  • Loading branch information
vireshk committed Jul 8, 2022
1 parent add1dc0 commit d613458
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions drivers/opp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1585,15 +1585,16 @@ void dev_pm_opp_remove_all_dynamic(struct device *dev)
}
EXPORT_SYMBOL_GPL(dev_pm_opp_remove_all_dynamic);

struct dev_pm_opp *_opp_allocate(struct opp_table *table)
struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table)
{
struct dev_pm_opp *opp;
int supply_count, supply_size, icc_size;

/* Allocate space for at least one supply */
supply_count = table->regulator_count > 0 ? table->regulator_count : 1;
supply_count = opp_table->regulator_count > 0 ?
opp_table->regulator_count : 1;
supply_size = sizeof(*opp->supplies) * supply_count;
icc_size = sizeof(*opp->bandwidth) * table->path_count;
icc_size = sizeof(*opp->bandwidth) * opp_table->path_count;

/* allocate new OPP node and supplies structures */
opp = kzalloc(sizeof(*opp) + supply_size + icc_size, GFP_KERNEL);
Expand Down
12 changes: 6 additions & 6 deletions drivers/opp/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* the table if any of the mentioned functions have been invoked in the interim.
*/
int dev_pm_opp_init_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table **table)
struct cpufreq_frequency_table **opp_table)
{
struct dev_pm_opp *opp;
struct cpufreq_frequency_table *freq_table = NULL;
Expand Down Expand Up @@ -76,7 +76,7 @@ int dev_pm_opp_init_cpufreq_table(struct device *dev,
freq_table[i].driver_data = i;
freq_table[i].frequency = CPUFREQ_TABLE_END;

*table = &freq_table[0];
*opp_table = &freq_table[0];

out:
if (ret)
Expand All @@ -94,13 +94,13 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_init_cpufreq_table);
* Free up the table allocated by dev_pm_opp_init_cpufreq_table
*/
void dev_pm_opp_free_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table **table)
struct cpufreq_frequency_table **opp_table)
{
if (!table)
if (!opp_table)
return;

kfree(*table);
*table = NULL;
kfree(*opp_table);
*opp_table = NULL;
}
EXPORT_SYMBOL_GPL(dev_pm_opp_free_cpufreq_table);
#endif /* CONFIG_CPU_FREQ */
Expand Down
12 changes: 6 additions & 6 deletions drivers/opp/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ void dev_pm_opp_of_remove_table(struct device *dev)
}
EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);

static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table,
static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *opp_table,
struct device_node *np, bool peak)
{
const char *name = peak ? "opp-peak-kBps" : "opp-avg-kBps";
Expand All @@ -780,9 +780,9 @@ static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table,
return -ENODEV;

count = prop->length / sizeof(u32);
if (table->path_count != count) {
if (opp_table->path_count != count) {
pr_err("%s: Mismatch between %s and paths (%d %d)\n",
__func__, name, count, table->path_count);
__func__, name, count, opp_table->path_count);
return -EINVAL;
}

Expand All @@ -808,7 +808,7 @@ static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *table,
return ret;
}

static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *table,
static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *opp_table,
struct device_node *np, bool *rate_not_available)
{
bool found = false;
Expand All @@ -832,10 +832,10 @@ static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *table,
* opp-peak-kBps = <path1_value path2_value>;
* opp-avg-kBps = <path1_value path2_value>;
*/
ret = _read_bw(new_opp, table, np, true);
ret = _read_bw(new_opp, opp_table, np, true);
if (!ret) {
found = true;
ret = _read_bw(new_opp, table, np, false);
ret = _read_bw(new_opp, opp_table, np, false);
}

/* The properties were found but we failed to parse them */
Expand Down

0 comments on commit d613458

Please sign in to comment.