linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] thermal: clean ups on thermal code base
@ 2013-03-22 21:00 Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 01/11] thermal: use strlcpy instead of strcpy Eduardo Valentin
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

Hey Rui,


Here is a sequence of fixes and documentation improvements
thermal code base. This should be first of a series of changes
I am planing to send out.

On this very first there is no change in functionality, as
the patches only change symbol names and updates kernel-doc
comments and their formants.



For those interested in testing and trying the driver, these patches are
also available, as usual, here:
git@gitorious.org:thermal-framework/thermal-framework.git thermal_work/thermal_fw/coding_style
https://git.gitorious.org/thermal-framework/thermal-framework.git thermal_work/thermal_fw/coding_style

Eduardo Valentin (11):
  thermal: use strlcpy instead of strcpy
  thermal: update driver license
  thermal: rename notify_thermal_framework to thermal_notify_framework
  thermal: rename get_thermal_instance to thermal_instance_get
  thermal: rename get_tz_trend to thermal_zone_trend_get
  thermal: use EXPORT_SYMBOL_GPL
  thermal: update kernel-doc for thermal_zone_bind_cooling_device
  thermal: update kernel-doc for thermal_zone_unbind_cooling_device
  thermal: update kernel-doc for thermal_cooling_device_register
  thermal: update kernel-doc for create_trip_attrs
  thermal: update kernel-doc for thermal_zone_device_register

 Documentation/thermal/sysfs-api.txt |    6 +-
 drivers/thermal/fair_share.c        |    2 +-
 drivers/thermal/step_wise.c         |    2 +-
 drivers/thermal/thermal_sys.c       |   90 ++++++++++++++++++++++++-----------
 include/linux/thermal.h             |    6 +-
 5 files changed, 70 insertions(+), 36 deletions(-)

-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 01/11] thermal: use strlcpy instead of strcpy
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 02/11] thermal: update driver license Eduardo Valentin
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

For memory boundaries safety, use strlcpy instead of strcpy.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 5b7863a..7875607 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1289,7 +1289,7 @@ thermal_cooling_device_register(char *type, void *devdata,
 		return ERR_PTR(result);
 	}
 
-	strcpy(cdev->type, type ? : "");
+	strlcpy(cdev->type, type ? : "", sizeof(cdev->type));
 	mutex_init(&cdev->lock);
 	INIT_LIST_HEAD(&cdev->thermal_instances);
 	cdev->ops = ops;
@@ -1594,7 +1594,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
 		return ERR_PTR(result);
 	}
 
-	strcpy(tz->type, type ? : "");
+	strlcpy(tz->type, type ? : "", sizeof(tz->type));
 	tz->ops = ops;
 	tz->tzp = tzp;
 	tz->device.class = &thermal_class;
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 02/11] thermal: update driver license
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 01/11] thermal: use strlcpy instead of strcpy Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 03/11] thermal: rename notify_thermal_framework to thermal_notify_framework Eduardo Valentin
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

As per the comment at the top of this file, this is a GPLv2 driver.
This patch updates the driver license accordingly.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 7875607..9542600 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -40,7 +40,7 @@
 
 MODULE_AUTHOR("Zhang Rui");
 MODULE_DESCRIPTION("Generic thermal management sysfs support");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
 
 static DEFINE_IDR(thermal_tz_idr);
 static DEFINE_IDR(thermal_cdev_idr);
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 03/11] thermal: rename notify_thermal_framework to thermal_notify_framework
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 01/11] thermal: use strlcpy instead of strcpy Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 02/11] thermal: update driver license Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 04/11] thermal: rename get_thermal_instance to thermal_instance_get Eduardo Valentin
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

To follow the prefix names used by the thermal exported functions,
this patch renames notify_thermal_framework to thermal_notify_framework.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 Documentation/thermal/sysfs-api.txt |    2 +-
 drivers/thermal/thermal_sys.c       |    6 +++---
 include/linux/thermal.h             |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 6859661..4b23190 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -363,7 +363,7 @@ This function returns the thermal_instance corresponding to a given
 {thermal_zone, cooling_device, trip_point} combination. Returns NULL
 if such an instance does not exist.
 
-5.3:notify_thermal_framework:
+5.3:thermal_notify_framework:
 This function handles the trip events from sensor drivers. It starts
 throttling the cooling devices according to the policy configured.
 For CRITICAL and HOT trip points, this notifies the respective drivers,
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 9542600..ffaf6d3 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1420,7 +1420,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
 EXPORT_SYMBOL(thermal_cdev_update);
 
 /**
- * notify_thermal_framework - Sensor drivers use this API to notify framework
+ * thermal_notify_framework - Sensor drivers use this API to notify framework
  * @tz:		thermal zone device
  * @trip:	indicates which trip point has been crossed
  *
@@ -1431,11 +1431,11 @@ EXPORT_SYMBOL(thermal_cdev_update);
  * The throttling policy is based on the configured platform data; if no
  * platform data is provided, this uses the step_wise throttling policy.
  */
-void notify_thermal_framework(struct thermal_zone_device *tz, int trip)
+void thermal_notify_framework(struct thermal_zone_device *tz, int trip)
 {
 	handle_thermal_trip(tz, trip);
 }
-EXPORT_SYMBOL(notify_thermal_framework);
+EXPORT_SYMBOL(thermal_notify_framework);
 
 /**
  * create_trip_attrs - create attributes for trip points
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index f0bd7f9..e8ec9d8 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -242,7 +242,7 @@ int get_tz_trend(struct thermal_zone_device *, int);
 struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
 		struct thermal_cooling_device *, int);
 void thermal_cdev_update(struct thermal_cooling_device *);
-void notify_thermal_framework(struct thermal_zone_device *, int);
+void thermal_notify_framework(struct thermal_zone_device *, int);
 
 int thermal_register_governor(struct thermal_governor *);
 void thermal_unregister_governor(struct thermal_governor *);
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 04/11] thermal: rename get_thermal_instance to thermal_instance_get
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (2 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 03/11] thermal: rename notify_thermal_framework to thermal_notify_framework Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 05/11] thermal: rename get_tz_trend to thermal_zone_trend_get Eduardo Valentin
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

To follow the prefix names used by the thermal exported functions,
this patch renames get_thermal_instance to thermal_instance_get.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 Documentation/thermal/sysfs-api.txt |    2 +-
 drivers/thermal/fair_share.c        |    2 +-
 drivers/thermal/thermal_sys.c       |    4 ++--
 include/linux/thermal.h             |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 4b23190..059b3bf 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -358,7 +358,7 @@ are supposed to implement the callback. If they don't, the thermal
 framework calculated the trend by comparing the previous and the current
 temperature values.
 
-5.2:get_thermal_instance:
+5.2:thermal_instance_get:
 This function returns the thermal_instance corresponding to a given
 {thermal_zone, cooling_device, trip_point} combination. Returns NULL
 if such an instance does not exist.
diff --git a/drivers/thermal/fair_share.c b/drivers/thermal/fair_share.c
index 792479f..f629446 100644
--- a/drivers/thermal/fair_share.c
+++ b/drivers/thermal/fair_share.c
@@ -95,7 +95,7 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
 			continue;
 
 		cdev = tzp->tbp[i].cdev;
-		instance = get_thermal_instance(tz, cdev, trip);
+		instance = thermal_instance_get(tz, cdev, trip);
 		if (!instance)
 			continue;
 
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index ffaf6d3..44e89c0 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -170,7 +170,7 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
 }
 EXPORT_SYMBOL(get_tz_trend);
 
-struct thermal_instance *get_thermal_instance(struct thermal_zone_device *tz,
+struct thermal_instance *thermal_instance_get(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int trip)
 {
 	struct thermal_instance *pos = NULL;
@@ -191,7 +191,7 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *tz,
 
 	return target_instance;
 }
-EXPORT_SYMBOL(get_thermal_instance);
+EXPORT_SYMBOL(thermal_instance_get);
 
 static void print_bind_err_msg(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int ret)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index e8ec9d8..e2a49e1 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -239,7 +239,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
 
 int get_tz_trend(struct thermal_zone_device *, int);
-struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
+struct thermal_instance *thermal_instance_get(struct thermal_zone_device *,
 		struct thermal_cooling_device *, int);
 void thermal_cdev_update(struct thermal_cooling_device *);
 void thermal_notify_framework(struct thermal_zone_device *, int);
-- 
1.7.7.1.488.ge8e1c

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

* [PATCH 05/11] thermal: rename get_tz_trend to thermal_zone_trend_get
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (3 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 04/11] thermal: rename get_thermal_instance to thermal_instance_get Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 06/11] thermal: use EXPORT_SYMBOL_GPL Eduardo Valentin
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

To follow the prefix names used by the thermal exported functions,
this patch renames get_tz_trend to thermal_zone_trend_get.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 Documentation/thermal/sysfs-api.txt |    2 +-
 drivers/thermal/step_wise.c         |    2 +-
 drivers/thermal/thermal_sys.c       |    4 ++--
 include/linux/thermal.h             |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 059b3bf..a9abb84 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -351,7 +351,7 @@ crosses any of the configured thresholds.
 
 5. Export Symbol APIs:
 
-5.1: get_tz_trend:
+5.1: thermal_zone_trend_get:
 This function returns the trend of a thermal zone, i.e the rate of change
 of temperature of the thermal zone. Ideally, the thermal sensor drivers
 are supposed to implement the callback. If they don't, the thermal
diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
index 407cde3..a640e2b 100644
--- a/drivers/thermal/step_wise.c
+++ b/drivers/thermal/step_wise.c
@@ -116,7 +116,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
 		tz->ops->get_trip_type(tz, trip, &trip_type);
 	}
 
-	trend = get_tz_trend(tz, trip);
+	trend = thermal_zone_trend_get(tz, trip);
 
 	if (tz->temperature >= trip_temp)
 		throttle = true;
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 44e89c0..242c82a 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -153,7 +153,7 @@ static void release_idr(struct idr *idr, struct mutex *lock, int id)
 		mutex_unlock(lock);
 }
 
-int get_tz_trend(struct thermal_zone_device *tz, int trip)
+int thermal_zone_trend_get(struct thermal_zone_device *tz, int trip)
 {
 	enum thermal_trend trend;
 
@@ -168,7 +168,7 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
 
 	return trend;
 }
-EXPORT_SYMBOL(get_tz_trend);
+EXPORT_SYMBOL(thermal_zone_trend_get);
 
 struct thermal_instance *thermal_instance_get(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int trip)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index e2a49e1..542a39c 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -238,7 +238,7 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
 		const struct thermal_cooling_device_ops *);
 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
 
-int get_tz_trend(struct thermal_zone_device *, int);
+int thermal_zone_trend_get(struct thermal_zone_device *, int);
 struct thermal_instance *thermal_instance_get(struct thermal_zone_device *,
 		struct thermal_cooling_device *, int);
 void thermal_cdev_update(struct thermal_cooling_device *);
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 06/11] thermal: use EXPORT_SYMBOL_GPL
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (4 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 05/11] thermal: rename get_tz_trend to thermal_zone_trend_get Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 07/11] thermal: update kernel-doc for thermal_zone_bind_cooling_device Eduardo Valentin
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

Restrict usage of GPL modules.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 242c82a..602596e 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -168,7 +168,7 @@ int thermal_zone_trend_get(struct thermal_zone_device *tz, int trip)
 
 	return trend;
 }
-EXPORT_SYMBOL(thermal_zone_trend_get);
+EXPORT_SYMBOL_GPL(thermal_zone_trend_get);
 
 struct thermal_instance *thermal_instance_get(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int trip)
@@ -191,7 +191,7 @@ struct thermal_instance *thermal_instance_get(struct thermal_zone_device *tz,
 
 	return target_instance;
 }
-EXPORT_SYMBOL(thermal_instance_get);
+EXPORT_SYMBOL_GPL(thermal_instance_get);
 
 static void print_bind_err_msg(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int ret)
@@ -434,7 +434,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
 }
-EXPORT_SYMBOL(thermal_zone_device_update);
+EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 
 static void thermal_zone_device_check(struct work_struct *work)
 {
@@ -1197,7 +1197,7 @@ free_mem:
 	kfree(dev);
 	return result;
 }
-EXPORT_SYMBOL(thermal_zone_bind_cooling_device);
+EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);
 
 /**
  * thermal_zone_unbind_cooling_device - unbind a cooling device from a thermal zone
@@ -1237,7 +1237,7 @@ unbind:
 	kfree(pos);
 	return 0;
 }
-EXPORT_SYMBOL(thermal_zone_unbind_cooling_device);
+EXPORT_SYMBOL_GPL(thermal_zone_unbind_cooling_device);
 
 static void thermal_release(struct device *dev)
 {
@@ -1334,7 +1334,7 @@ unregister:
 	device_unregister(&cdev->device);
 	return ERR_PTR(result);
 }
-EXPORT_SYMBOL(thermal_cooling_device_register);
+EXPORT_SYMBOL_GPL(thermal_cooling_device_register);
 
 /**
  * thermal_cooling_device_unregister - removes the registered thermal cooling device
@@ -1394,7 +1394,7 @@ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
 	device_unregister(&cdev->device);
 	return;
 }
-EXPORT_SYMBOL(thermal_cooling_device_unregister);
+EXPORT_SYMBOL_GPL(thermal_cooling_device_unregister);
 
 void thermal_cdev_update(struct thermal_cooling_device *cdev)
 {
@@ -1417,7 +1417,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
 	cdev->ops->set_cur_state(cdev, target);
 	cdev->updated = true;
 }
-EXPORT_SYMBOL(thermal_cdev_update);
+EXPORT_SYMBOL_GPL(thermal_cdev_update);
 
 /**
  * thermal_notify_framework - Sensor drivers use this API to notify framework
@@ -1435,7 +1435,7 @@ void thermal_notify_framework(struct thermal_zone_device *tz, int trip)
 {
 	handle_thermal_trip(tz, trip);
 }
-EXPORT_SYMBOL(thermal_notify_framework);
+EXPORT_SYMBOL_GPL(thermal_notify_framework);
 
 /**
  * create_trip_attrs - create attributes for trip points
@@ -1687,7 +1687,7 @@ unregister:
 	device_unregister(&tz->device);
 	return ERR_PTR(result);
 }
-EXPORT_SYMBOL(thermal_zone_device_register);
+EXPORT_SYMBOL_GPL(thermal_zone_device_register);
 
 /**
  * thermal_device_unregister - removes the registered thermal zone device
@@ -1754,7 +1754,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 	device_unregister(&tz->device);
 	return;
 }
-EXPORT_SYMBOL(thermal_zone_device_unregister);
+EXPORT_SYMBOL_GPL(thermal_zone_device_unregister);
 
 #ifdef CONFIG_NET
 static struct genl_family thermal_event_genl_family = {
@@ -1832,7 +1832,7 @@ int thermal_generate_netlink_event(struct thermal_zone_device *tz,
 
 	return result;
 }
-EXPORT_SYMBOL(thermal_generate_netlink_event);
+EXPORT_SYMBOL_GPL(thermal_generate_netlink_event);
 
 static int genetlink_init(void)
 {
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 07/11] thermal: update kernel-doc for thermal_zone_bind_cooling_device
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (5 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 06/11] thermal: use EXPORT_SYMBOL_GPL Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 08/11] thermal: update kernel-doc for thermal_zone_unbind_cooling_device Eduardo Valentin
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

This patch updates the documentation for thermal_zone_bind_cooling_device
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 602596e..8acaab6 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1097,13 +1097,23 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)
 #endif
 
 /**
- * thermal_zone_bind_cooling_device - bind a cooling device to a thermal zone
- * @tz:		thermal zone device
+ * thermal_zone_bind_cooling_device() - bind a cooling device to a thermal zone
+ * @tz:		pointer to struct thermal_zone_device
  * @trip:	indicates which trip point the cooling devices is
  *		associated with in this thermal zone.
- * @cdev:	thermal cooling device
+ * @cdev:	pointer to struct thermal_cooling_device
+ * @upper:	the Maximum cooling state for this trip point.
+ *		THERMAL_NO_LIMIT means no upper limit,
+ *		and the cooling device can be in max_state.
+ * @lower:	the Minimum cooling state can be used for this trip point.
+ *		THERMAL_NO_LIMIT means no lower limit,
+ *		and the cooling device can be in cooling state 0.
  *
+ * This interface function bind a thermal cooling device to the certain trip
+ * point of a thermal zone device.
  * This function is usually called in the thermal zone device .bind callback.
+ *
+ * Return: 0 on success, the proper error value otherwise.
  */
 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
 				     int trip,
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 08/11] thermal: update kernel-doc for thermal_zone_unbind_cooling_device
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (6 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 07/11] thermal: update kernel-doc for thermal_zone_bind_cooling_device Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 09/11] thermal: update kernel-doc for thermal_cooling_device_register Eduardo Valentin
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

This patch updates the documentation for thermal_zone_unbind_cooling_device
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 8acaab6..98d7d53 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1210,13 +1210,18 @@ free_mem:
 EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);
 
 /**
- * thermal_zone_unbind_cooling_device - unbind a cooling device from a thermal zone
- * @tz:		thermal zone device
+ * thermal_zone_unbind_cooling_device() - unbind a cooling device from a
+ *					  thermal zone.
+ * @tz:		pointer to a struct thermal_zone_device.
  * @trip:	indicates which trip point the cooling devices is
  *		associated with in this thermal zone.
- * @cdev:	thermal cooling device
+ * @cdev:	pointer to a struct thermal_cooling_device.
  *
+ * This interface function unbind a thermal cooling device from the certain
+ * trip point of a thermal zone device.
  * This function is usually called in the thermal zone device .unbind callback.
+ *
+ * Return: 0 on success, the proper error value otherwise.
  */
 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
 				       int trip,
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 09/11] thermal: update kernel-doc for thermal_cooling_device_register
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (7 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 08/11] thermal: update kernel-doc for thermal_zone_unbind_cooling_device Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 10/11] thermal: update kernel-doc for create_trip_attrs Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 11/11] thermal: update kernel-doc for thermal_zone_device_register Eduardo Valentin
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

This patch updates the documentation for thermal_cooling_device_register
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 98d7d53..f3a4e17 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1275,10 +1275,17 @@ static struct class thermal_class = {
 };
 
 /**
- * thermal_cooling_device_register - register a new thermal cooling device
+ * thermal_cooling_device_register() - register a new thermal cooling device
  * @type:	the thermal cooling device type.
  * @devdata:	device private data.
  * @ops:		standard thermal cooling devices callbacks.
+ *
+ * This interface function adds a new thermal cooling device (fan/processor/...)
+ * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
+ * to all the thermal zone devices register at the same time.
+ *
+ * Return: a pointer to the created struct thermal_cooling_device or an
+ * ERR_PTR. Caller must check return value with IS_ERR*() helpers.
  */
 struct thermal_cooling_device *
 thermal_cooling_device_register(char *type, void *devdata,
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 10/11] thermal: update kernel-doc for create_trip_attrs
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (8 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 09/11] thermal: update kernel-doc for thermal_cooling_device_register Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  2013-03-22 21:00 ` [PATCH 11/11] thermal: update kernel-doc for thermal_zone_device_register Eduardo Valentin
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

This patch updates the documentation for create_trip_attrs
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index f3a4e17..4cff199 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1460,9 +1460,14 @@ void thermal_notify_framework(struct thermal_zone_device *tz, int trip)
 EXPORT_SYMBOL_GPL(thermal_notify_framework);
 
 /**
- * create_trip_attrs - create attributes for trip points
+ * create_trip_attrs() - create attributes for trip points
  * @tz:		the thermal zone device
  * @mask:	Writeable trip point bitmap.
+ *
+ * helper function to instantiate sysfs entries for every trip
+ * point and its properties of a struct thermal_zone_device.
+ *
+ * Return: 0 on success, the proper error value otherwise.
  */
 static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
 {
-- 
1.7.7.1.488.ge8e1c


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

* [PATCH 11/11] thermal: update kernel-doc for thermal_zone_device_register
  2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
                   ` (9 preceding siblings ...)
  2013-03-22 21:00 ` [PATCH 10/11] thermal: update kernel-doc for create_trip_attrs Eduardo Valentin
@ 2013-03-22 21:00 ` Eduardo Valentin
  10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Valentin @ 2013-03-22 21:00 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-pm, linux-kernel, Eduardo Valentin

This patch updates the documentation for thermal_zone_device_register
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
---
 drivers/thermal/thermal_sys.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 4cff199..5bd95d4 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -1568,7 +1568,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
 }
 
 /**
- * thermal_zone_device_register - register a new thermal zone device
+ * thermal_zone_device_register() - register a new thermal zone device
  * @type:	the thermal zone device type
  * @trips:	the number of trip points the thermal zone support
  * @mask:	a bit string indicating the writeablility of trip points
@@ -1581,8 +1581,15 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
  *		   whether trip points have been crossed (0 for interrupt
  *		   driven systems)
  *
+ * This interface function adds a new thermal zone device (sensor) to
+ * /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
+ * thermal cooling devices registered at the same time.
  * thermal_zone_device_unregister() must be called when the device is no
  * longer needed. The passive cooling depends on the .get_trend() return value.
+ *
+ * Return: a pointer to the created struct thermal_zone_device or an
+ * in case of error, an ERR_PTR. Caller must check return value with
+ * IS_ERR*() helpers.
  */
 struct thermal_zone_device *thermal_zone_device_register(const char *type,
 	int trips, int mask, void *devdata,
-- 
1.7.7.1.488.ge8e1c


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

end of thread, other threads:[~2013-03-22 21:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-22 21:00 [PATCH 00/11] thermal: clean ups on thermal code base Eduardo Valentin
2013-03-22 21:00 ` [PATCH 01/11] thermal: use strlcpy instead of strcpy Eduardo Valentin
2013-03-22 21:00 ` [PATCH 02/11] thermal: update driver license Eduardo Valentin
2013-03-22 21:00 ` [PATCH 03/11] thermal: rename notify_thermal_framework to thermal_notify_framework Eduardo Valentin
2013-03-22 21:00 ` [PATCH 04/11] thermal: rename get_thermal_instance to thermal_instance_get Eduardo Valentin
2013-03-22 21:00 ` [PATCH 05/11] thermal: rename get_tz_trend to thermal_zone_trend_get Eduardo Valentin
2013-03-22 21:00 ` [PATCH 06/11] thermal: use EXPORT_SYMBOL_GPL Eduardo Valentin
2013-03-22 21:00 ` [PATCH 07/11] thermal: update kernel-doc for thermal_zone_bind_cooling_device Eduardo Valentin
2013-03-22 21:00 ` [PATCH 08/11] thermal: update kernel-doc for thermal_zone_unbind_cooling_device Eduardo Valentin
2013-03-22 21:00 ` [PATCH 09/11] thermal: update kernel-doc for thermal_cooling_device_register Eduardo Valentin
2013-03-22 21:00 ` [PATCH 10/11] thermal: update kernel-doc for create_trip_attrs Eduardo Valentin
2013-03-22 21:00 ` [PATCH 11/11] thermal: update kernel-doc for thermal_zone_device_register Eduardo Valentin

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).