[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250421074004.yttb42qq4p5xzi3o@vireshk-i7>
Date: Mon, 21 Apr 2025 13:10:04 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Praveen Talari <quic_ptalari@...cinc.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org, devicetree@...r.kernel.org,
linux-pm@...r.kernel.org, psodagud@...cinc.com, djaggi@...cinc.com,
quic_msavaliy@...cinc.com, quic_vtanuku@...cinc.com,
quic_arandive@...cinc.com, quic_mnaresh@...cinc.com,
quic_shazhuss@...cinc.com, Nikunj Kela <quic_nkela@...cinc.com>
Subject: Re: [PATCH v2 1/9] opp: add new helper API dev_pm_opp_set_level()
On 18-04-25, 20:42, Praveen Talari wrote:
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 73e9a3b2f29b..a9bca9502f71 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -3151,3 +3151,25 @@ void dev_pm_opp_remove_table(struct device *dev)
> dev_pm_opp_put_opp_table(opp_table);
> }
> EXPORT_SYMBOL_GPL(dev_pm_opp_remove_table);
> +
> +/*
> + * dev_pm_opp_set_level() - Configure device for a level
> + * @dev: device for which we do this operation
> + * @level: level to set to
> + *
> + * Return: 0 on success, a negative error number otherwise.
> + */
> +int dev_pm_opp_set_level(struct device *dev, unsigned int level)
I would rather move this to pm_opp.h as an inline helper.
> +{
> + struct dev_pm_opp *opp = dev_pm_opp_find_level_exact(dev, level);
> + int ret;
> +
> + if (IS_ERR(opp))
> + return -EINVAL;
Why not reuse the same error value ?
> +
> + ret = dev_pm_opp_set_opp(dev, opp);
> + dev_pm_opp_put(opp);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(dev_pm_opp_set_level);
Make the changes and send it separately (or with the series, your
choice), I will apply it to the OPP tree. Thanks.
--
viresh
Powered by blists - more mailing lists