lkml.org 
[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] thermal/drivers/cpu_cooling: Unregister with the policy
On 24-06-19, 09:45, Daniel Lezcano wrote:
> Actually I'm asking your opinion :)
>
> The structure in drivers/thermal/imx_thermal.c
>
> struct imx_thermal_data {
> struct cpufreq_policy *policy; <<<< in the thermal data ?!
> [ ... ]
> };
>
> And then:
>
> #ifdef CONFIG_CPU_FREQ
> /*
> * Create cooling device in case no #cooling-cells property is available in
> * CPU node
> */
> static int imx_thermal_register_legacy_cooling(struct imx_thermal_data
> *data)
> {
> struct device_node *np;
> int ret;
>
> data->policy = cpufreq_cpu_get(0);
> if (!data->policy) {
> pr_debug("%s: CPUFreq policy not found\n", __func__);
> return -EPROBE_DEFER;
> }
>
> np = of_get_cpu_node(data->policy->cpu, NULL);
>
> if (!np || !of_find_property(np, "#cooling-cells", NULL)) {
> data->cdev = cpufreq_cooling_register(data->policy);
> if (IS_ERR(data->cdev)) {
> ret = PTR_ERR(data->cdev);
> cpufreq_cpu_put(data->policy);
> return ret;
> }
> }
>
> return 0;
> }
>
> [ ... ]
>
> Shouldn't this be move in the drivers/cpufreq/<whatever driver> ?

Sure, we have platform specific drivers where this can be moved :)

--
viresh

\
 
 \ /
  Last update: 2019-06-24 11:40    [W:0.034 / U:0.740 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site