diff mbox

[V6,15/30] thermal: exynos: Return success even if no cooling data supplied

Message ID 1371451599-31035-16-git-send-email-amit.daniel@samsung.com (mailing list archive)
State Superseded, archived
Delegated to: Eduardo Valentin
Headers show

Commit Message

Amit Kachhap June 17, 2013, 6:46 a.m. UTC
This patch removes the error return in the bind/unbind routine
as the platform may not register any cpufreq cooling data.

Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---
 drivers/thermal/samsung/exynos_thermal_common.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Eduardo Valentin June 19, 2013, 10:54 p.m. UTC | #1
On 17-06-2013 02:46, Amit Daniel Kachhap wrote:
> This patch removes the error return in the bind/unbind routine
> as the platform may not register any cpufreq cooling data.
> 
> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> ---
>  drivers/thermal/samsung/exynos_thermal_common.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
> index 7064eb7..86d39aa 100644
> --- a/drivers/thermal/samsung/exynos_thermal_common.c
> +++ b/drivers/thermal/samsung/exynos_thermal_common.c
> @@ -131,7 +131,7 @@ static int exynos_bind(struct thermal_zone_device *thermal,
>  	tab_size = data->cooling_data.freq_clip_count;
>  
>  	if (tab_ptr == NULL || tab_size == 0)
> -		return -EINVAL;
> +		return 0;
>  
>  	/* find the cooling device registered*/
>  	for (i = 0; i < th_zone->cool_dev_size; i++)
> @@ -180,7 +180,7 @@ static int exynos_unbind(struct thermal_zone_device *thermal,
>  	tab_size = data->cooling_data.freq_clip_count;
>  
>  	if (tab_size == 0)
> -		return -EINVAL;
> +		return 0;
>  
>  	/* find the cooling device registered*/
>  	for (i = 0; i < th_zone->cool_dev_size; i++)
> 

I have one question before acking this one: what happens if one
registers a TMU with no freq tab? Say the case where you have three
sensors, just like SOC_ARCH_EXYNOS5440. Would you register
cpufreq_cooling device for all of them? In other way, are you having 3
cpufreq_cooling devices?
Eduardo Valentin June 19, 2013, 11:04 p.m. UTC | #2
On 19-06-2013 18:54, Eduardo Valentin wrote:
> On 17-06-2013 02:46, Amit Daniel Kachhap wrote:
>> This patch removes the error return in the bind/unbind routine
>> as the platform may not register any cpufreq cooling data.
>>
>> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
>> Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
>> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
>> ---
>>  drivers/thermal/samsung/exynos_thermal_common.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
>> index 7064eb7..86d39aa 100644
>> --- a/drivers/thermal/samsung/exynos_thermal_common.c
>> +++ b/drivers/thermal/samsung/exynos_thermal_common.c
>> @@ -131,7 +131,7 @@ static int exynos_bind(struct thermal_zone_device *thermal,
>>  	tab_size = data->cooling_data.freq_clip_count;
>>  
>>  	if (tab_ptr == NULL || tab_size == 0)
>> -		return -EINVAL;
>> +		return 0;
>>  
>>  	/* find the cooling device registered*/
>>  	for (i = 0; i < th_zone->cool_dev_size; i++)
>> @@ -180,7 +180,7 @@ static int exynos_unbind(struct thermal_zone_device *thermal,
>>  	tab_size = data->cooling_data.freq_clip_count;
>>  
>>  	if (tab_size == 0)
>> -		return -EINVAL;
>> +		return 0;
>>  
>>  	/* find the cooling device registered*/
>>  	for (i = 0; i < th_zone->cool_dev_size; i++)
>>
> 
> I have one question before acking this one: what happens if one
> registers a TMU with no freq tab? Say the case where you have three
> sensors, just like SOC_ARCH_EXYNOS5440. Would you register
> cpufreq_cooling device for all of them? In other way, are you having 3
> cpufreq_cooling devices?

I am actually fine with this patch. just saw that you adjust things on
patch 16.

Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>

> 
>
diff mbox

Patch

diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
index 7064eb7..86d39aa 100644
--- a/drivers/thermal/samsung/exynos_thermal_common.c
+++ b/drivers/thermal/samsung/exynos_thermal_common.c
@@ -131,7 +131,7 @@  static int exynos_bind(struct thermal_zone_device *thermal,
 	tab_size = data->cooling_data.freq_clip_count;
 
 	if (tab_ptr == NULL || tab_size == 0)
-		return -EINVAL;
+		return 0;
 
 	/* find the cooling device registered*/
 	for (i = 0; i < th_zone->cool_dev_size; i++)
@@ -180,7 +180,7 @@  static int exynos_unbind(struct thermal_zone_device *thermal,
 	tab_size = data->cooling_data.freq_clip_count;
 
 	if (tab_size == 0)
-		return -EINVAL;
+		return 0;
 
 	/* find the cooling device registered*/
 	for (i = 0; i < th_zone->cool_dev_size; i++)