Message ID | 20210215075139.30772-2-nicola.mazzucato@arm.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | viresh kumar |
Headers | show |
Series | CPUFreq: Add support for opp-sharing cpus | expand |
On 15-02-21, 07:51, Nicola Mazzucato wrote: > The current implementation of the scmi_cpufreq_init() function returns > -EPROBE_DEFER when the OPP table is not populated. In practice the > cpufreq core cannot handle this error code. > Therefore, fix the return value and clarify the error message. > > Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> > Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com> > --- > drivers/cpufreq/scmi-cpufreq.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c > index 491a0a24fb1e..34bf2eb8d465 100644 > --- a/drivers/cpufreq/scmi-cpufreq.c > +++ b/drivers/cpufreq/scmi-cpufreq.c > @@ -155,9 +155,11 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) > > nr_opp = dev_pm_opp_get_opp_count(cpu_dev); > if (nr_opp <= 0) { > - dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n"); > - ret = -EPROBE_DEFER; > - goto out_free_opp; Why change goto label as well ? > + dev_err(cpu_dev, "%s: No OPPs for this device: %d\n", > + __func__, ret); > + > + ret = -ENODEV; > + goto out_free_priv; > } > > priv = kzalloc(sizeof(*priv), GFP_KERNEL); > -- > 2.27.0
Hi Viresh, On 2/18/21 10:35 AM, Viresh Kumar wrote: > On 15-02-21, 07:51, Nicola Mazzucato wrote: >> The current implementation of the scmi_cpufreq_init() function returns >> -EPROBE_DEFER when the OPP table is not populated. In practice the >> cpufreq core cannot handle this error code. >> Therefore, fix the return value and clarify the error message. >> >> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> >> Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com> >> --- >> drivers/cpufreq/scmi-cpufreq.c | 8 +++++--- >> 1 file changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c >> index 491a0a24fb1e..34bf2eb8d465 100644 >> --- a/drivers/cpufreq/scmi-cpufreq.c >> +++ b/drivers/cpufreq/scmi-cpufreq.c >> @@ -155,9 +155,11 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) >> >> nr_opp = dev_pm_opp_get_opp_count(cpu_dev); >> if (nr_opp <= 0) { >> - dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n"); >> - ret = -EPROBE_DEFER; >> - goto out_free_opp; > > Why change goto label as well ? oops! thanks for spotting this :) > >> + dev_err(cpu_dev, "%s: No OPPs for this device: %d\n", >> + __func__, ret); >> + >> + ret = -ENODEV; >> + goto out_free_priv; >> } >> >> priv = kzalloc(sizeof(*priv), GFP_KERNEL); >> -- >> 2.27.0 >
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 491a0a24fb1e..34bf2eb8d465 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -155,9 +155,11 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) nr_opp = dev_pm_opp_get_opp_count(cpu_dev); if (nr_opp <= 0) { - dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n"); - ret = -EPROBE_DEFER; - goto out_free_opp; + dev_err(cpu_dev, "%s: No OPPs for this device: %d\n", + __func__, ret); + + ret = -ENODEV; + goto out_free_priv; } priv = kzalloc(sizeof(*priv), GFP_KERNEL);