linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: of-thermal: Fix setting of set_emul_temp hook
@ 2016-06-02  8:54 Keerthy
  2016-06-10  6:27 ` Keerthy
  0 siblings, 1 reply; 3+ messages in thread
From: Keerthy @ 2016-06-02  8:54 UTC (permalink / raw)
  To: edubezval, rui.zhang; +Cc: j-keerthy, nm, linux-omap, linux-kernel, linux-pm

Currently thermal zone set_emul_temp is set unconditionally
with of_thermal_set_emul_temp function. Set this only if the
set_emul_temp hook is provided for thermal_zone_of_device_ops.

This fixes emul_temp failures on platforms for which set_emul_temp
hook is not populated.

Fixes: "184a4bf623f (thermal: of: Extend current
	of-thermal.c code to allow setting emulated temp)"
Suggested-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/of-thermal.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index b8e509c..93d8ce0 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -181,9 +181,6 @@ static int of_thermal_set_emul_temp(struct thermal_zone_device *tz,
 {
 	struct __thermal_zone *data = tz->devdata;
 
-	if (!data->ops || !data->ops->set_emul_temp)
-		return -EINVAL;
-
 	return data->ops->set_emul_temp(data->sensor_data, temp);
 }
 
@@ -427,7 +424,9 @@ thermal_zone_of_add_sensor(struct device_node *zone,
 
 	tzd->ops->get_temp = of_thermal_get_temp;
 	tzd->ops->get_trend = of_thermal_get_trend;
-	tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
+	if (ops->set_emul_temp)
+		tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
+
 	mutex_unlock(&tzd->lock);
 
 	return tzd;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal: of-thermal: Fix setting of set_emul_temp hook
  2016-06-02  8:54 [PATCH] thermal: of-thermal: Fix setting of set_emul_temp hook Keerthy
@ 2016-06-10  6:27 ` Keerthy
  2016-06-27  6:18   ` Keerthy
  0 siblings, 1 reply; 3+ messages in thread
From: Keerthy @ 2016-06-10  6:27 UTC (permalink / raw)
  To: Keerthy, edubezval, rui.zhang; +Cc: nm, linux-omap, linux-kernel, linux-pm



On Thursday 02 June 2016 02:24 PM, Keerthy wrote:
> Currently thermal zone set_emul_temp is set unconditionally
> with of_thermal_set_emul_temp function. Set this only if the
> set_emul_temp hook is provided for thermal_zone_of_device_ops.
>
> This fixes emul_temp failures on platforms for which set_emul_temp
> hook is not populated.

Eduardo,

A gentle ping on this patch.


>
> Fixes: "184a4bf623f (thermal: of: Extend current
> 	of-thermal.c code to allow setting emulated temp)"
> Suggested-by: Eduardo Valentin <edubezval@gmail.com>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>   drivers/thermal/of-thermal.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index b8e509c..93d8ce0 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -181,9 +181,6 @@ static int of_thermal_set_emul_temp(struct thermal_zone_device *tz,
>   {
>   	struct __thermal_zone *data = tz->devdata;
>
> -	if (!data->ops || !data->ops->set_emul_temp)
> -		return -EINVAL;
> -
>   	return data->ops->set_emul_temp(data->sensor_data, temp);
>   }
>
> @@ -427,7 +424,9 @@ thermal_zone_of_add_sensor(struct device_node *zone,
>
>   	tzd->ops->get_temp = of_thermal_get_temp;
>   	tzd->ops->get_trend = of_thermal_get_trend;
> -	tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
> +	if (ops->set_emul_temp)
> +		tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
> +
>   	mutex_unlock(&tzd->lock);
>
>   	return tzd;
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal: of-thermal: Fix setting of set_emul_temp hook
  2016-06-10  6:27 ` Keerthy
@ 2016-06-27  6:18   ` Keerthy
  0 siblings, 0 replies; 3+ messages in thread
From: Keerthy @ 2016-06-27  6:18 UTC (permalink / raw)
  To: Keerthy, edubezval, rui.zhang; +Cc: nm, linux-omap, linux-kernel, linux-pm



On Friday 10 June 2016 11:57 AM, Keerthy wrote:
>
>
> On Thursday 02 June 2016 02:24 PM, Keerthy wrote:
>> Currently thermal zone set_emul_temp is set unconditionally
>> with of_thermal_set_emul_temp function. Set this only if the
>> set_emul_temp hook is provided for thermal_zone_of_device_ops.
>>
>> This fixes emul_temp failures on platforms for which set_emul_temp
>> hook is not populated.
>
> Eduardo,
>
> A gentle ping on this patch.

Eduardo,

Another gentle ping.


>
>
>>
>> Fixes: "184a4bf623f (thermal: of: Extend current
>>     of-thermal.c code to allow setting emulated temp)"
>> Suggested-by: Eduardo Valentin <edubezval@gmail.com>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>   drivers/thermal/of-thermal.c | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
>> index b8e509c..93d8ce0 100644
>> --- a/drivers/thermal/of-thermal.c
>> +++ b/drivers/thermal/of-thermal.c
>> @@ -181,9 +181,6 @@ static int of_thermal_set_emul_temp(struct
>> thermal_zone_device *tz,
>>   {
>>       struct __thermal_zone *data = tz->devdata;
>>
>> -    if (!data->ops || !data->ops->set_emul_temp)
>> -        return -EINVAL;
>> -
>>       return data->ops->set_emul_temp(data->sensor_data, temp);
>>   }
>>
>> @@ -427,7 +424,9 @@ thermal_zone_of_add_sensor(struct device_node *zone,
>>
>>       tzd->ops->get_temp = of_thermal_get_temp;
>>       tzd->ops->get_trend = of_thermal_get_trend;
>> -    tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
>> +    if (ops->set_emul_temp)
>> +        tzd->ops->set_emul_temp = of_thermal_set_emul_temp;
>> +
>>       mutex_unlock(&tzd->lock);
>>
>>       return tzd;
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-27  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02  8:54 [PATCH] thermal: of-thermal: Fix setting of set_emul_temp hook Keerthy
2016-06-10  6:27 ` Keerthy
2016-06-27  6:18   ` Keerthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).