2013-05-18 09:50:40

by Jonghwa Lee

[permalink] [raw]
Subject: [PATCH 1/3] Thermal: core: Ask .get_trip_temp() to register thermal zone device.

This patch adds a requirement needing .get_trip_temp() callback
function for registering thermal zone device. This function is
used when thermal zone is updated and essential where thermal core
handles thermal trip based only polling way not hw interrupt.

Signed-off-by: Jonghwa Lee <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
---
drivers/thermal/thermal_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index d755440..f753f48 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1624,7 +1624,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
if (!ops || !ops->get_temp)
return ERR_PTR(-EINVAL);

- if (trips > 0 && !ops->get_trip_type)
+ if (trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp))
return ERR_PTR(-EINVAL);

tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL);
--
1.7.9.5


2013-05-20 06:44:14

by R, Durgadoss

[permalink] [raw]
Subject: RE: [PATCH 1/3] Thermal: core: Ask .get_trip_temp() to register thermal zone device.

> -----Original Message-----
> From: [email protected] [mailto:linux-pm-
> [email protected]] On Behalf Of Jonghwa Lee
> Sent: Saturday, May 18, 2013 3:20 PM
> To: [email protected]
> Cc: [email protected]; Zhang, Rui; Eduardo Valentin; Amit Dinel
> Kachhap; Jonghwa Lee; MyungJoo Ham
> Subject: [PATCH 1/3] Thermal: core: Ask .get_trip_temp() to register thermal
> zone device.
>
> This patch adds a requirement needing .get_trip_temp() callback
> function for registering thermal zone device. This function is
> used when thermal zone is updated and essential where thermal core
> handles thermal trip based only polling way not hw interrupt.

Nice catch. Looks fine,
Acked-by: Durgadoss R <[email protected]>

Thanks,
Durga

>
> Signed-off-by: Jonghwa Lee <[email protected]>
> Signed-off-by: MyungJoo Ham <[email protected]>
> ---
> drivers/thermal/thermal_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c
> index d755440..f753f48 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -1624,7 +1624,7 @@ struct thermal_zone_device
> *thermal_zone_device_register(const char *type,
> if (!ops || !ops->get_temp)
> return ERR_PTR(-EINVAL);
>
> - if (trips > 0 && !ops->get_trip_type)
> + if (trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp))
> return ERR_PTR(-EINVAL);
>
> tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2013-05-20 15:51:17

by Zhang, Rui

[permalink] [raw]
Subject: RE: [PATCH 1/3] Thermal: core: Ask .get_trip_temp() to register thermal zone device.



> -----Original Message-----
> From: Jonghwa Lee [mailto:[email protected]]
> Sent: Saturday, May 18, 2013 5:50 PM
> To: [email protected]
> Cc: [email protected]; Zhang, Rui; Eduardo Valentin; Amit
> Dinel Kachhap; Jonghwa Lee; MyungJoo Ham
> Subject: [PATCH 1/3] Thermal: core: Ask .get_trip_temp() to register
> thermal zone device.
> Importance: High
>
> This patch adds a requirement needing .get_trip_temp() callback
> function for registering thermal zone device. This function is used
> when thermal zone is updated and essential where thermal core handles
> thermal trip based only polling way not hw interrupt.
>
> Signed-off-by: Jonghwa Lee <[email protected]>
> Signed-off-by: MyungJoo Ham <[email protected]>

Applied to thermal -next.

Thanks,
rui
> ---
> drivers/thermal/thermal_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c index d755440..f753f48 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -1624,7 +1624,7 @@ struct thermal_zone_device
> *thermal_zone_device_register(const char *type,
> if (!ops || !ops->get_temp)
> return ERR_PTR(-EINVAL);
>
> - if (trips > 0 && !ops->get_trip_type)
> + if (trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp))
> return ERR_PTR(-EINVAL);
>
> tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL);
> --
> 1.7.9.5