Re: v3.13.5 intel_pstate: cpufreq: __cpufreq_add_dev: ->get() failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12 March 2014 07:53, Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> wrote:
>> Is having ->target set mutually exclusive with having ->setpolicy set?
>
> It is quite clear that having ->setpolicy implies having ->target unset,
> because both drivers with ->setpolicy (intel_pstate and longrun) don't
> have ->target set.
>
> Now, are there any *other* cpufreq drivers without ->target?
>
> In either case, in my opinion we should just make cpufreq_register_driver()
> fail for drivers having both ->set_policy and ->target set at the same time.
> Like in the patch below.
>
> Rafael
>
>
> ---
>  drivers/cpufreq/cpufreq.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: linux-pm/drivers/cpufreq/cpufreq.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/cpufreq.c
> +++ linux-pm/drivers/cpufreq/cpufreq.c
> @@ -2306,7 +2306,9 @@ int cpufreq_register_driver(struct cpufr
>
>         if (!driver_data || !driver_data->verify || !driver_data->init ||
>             !(driver_data->setpolicy || driver_data->target_index ||
> -                   driver_data->target))
> +                   driver_data->target) ||
> +            (driver_data->setpolicy && (driver_data->target_index ||
> +                   driver_data->target)))
>                 return -EINVAL;
>
>         pr_debug("trying to register driver %s\n", driver_data->name);

Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux