Re: [PATCH 1/4] PM / OPP: Reorganize _generic_set_opp_regulator()

From: Stephen Boyd
Date: Mon May 22 2017 - 21:09:55 EST


On 05/17, Viresh Kumar wrote:
> The code was overly complicated here because of the limitations that we
> had with RCUs (Couldn't use opp-table and OPPs outside RCU protected
> section and can't call sleep-able routines from within that). But that
> is long gone now.
>
> Reorganize _generic_set_opp_regulator() in order to avoid using "struct
> dev_pm_set_opp_data" and copying data into it for the case where
> opp_table->set_opp is not set.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> ---
> drivers/base/power/opp/core.c | 73 ++++++++++++++++++++-----------------------
> 1 file changed, 34 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c
> index dae61720b314..402b9e86d77c 100644
> --- a/drivers/base/power/opp/core.c
> +++ b/drivers/base/power/opp/core.c
> @@ -543,17 +543,18 @@ _generic_set_opp_clk_only(struct device *dev, struct clk *clk,
> return ret;
> }
>
> -static int _generic_set_opp(struct dev_pm_set_opp_data *data)
> +static int _generic_set_opp_regulator(struct opp_table *opp_table,

Can opp_table be const?

> + struct device *dev,

Maybe dev too, but that looks like a ripple effect so maybe
in another patch.

> + unsigned long old_freq,
> + unsigned long freq,
> + struct dev_pm_opp_supply *old_supply,
> + struct dev_pm_opp_supply *new_supply)

Otherwise

Reviewed-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project