[1/2] Thermal: Move struct thermal_cooling_device_instance to thermal.h

Message ID 1344597614-13998-2-git-send-email-hongbo.zhang@linaro.com
State New
Headers show

Commit Message

Hongbo Zhang Aug. 10, 2012, 11:20 a.m.
From: "hongbo.zhang" <hongbo.zhang@linaro.com>

A thermal driver may need to walk through the cooling devices binded to
itself, which are listed in cooling_devices of thermal_zone_device, and
this goal cannot be achieved without moving this structure declaration
to the public header file.

Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com>
---
 drivers/thermal/thermal_sys.c |   11 -----------
 include/linux/thermal.h       |   12 ++++++++++++
 2 files changed, 12 insertions(+), 11 deletions(-)

Comments

Hongbo Zhang Aug. 16, 2012, 6:22 a.m. | #1
Add more people into list.

On 10 August 2012 19:20, hongbo.zhang <hongbo.zhang@linaro.org> wrote:

> From: "hongbo.zhang" <hongbo.zhang@linaro.com>
>
> A thermal driver may need to walk through the cooling devices binded to
> itself, which are listed in cooling_devices of thermal_zone_device, and
> this goal cannot be achieved without moving this structure declaration
> to the public header file.
>
> Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com>
> ---
>  drivers/thermal/thermal_sys.c |   11 -----------
>  include/linux/thermal.h       |   12 ++++++++++++
>  2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
> index 2ab31e4..0c5900f 100644
> --- a/drivers/thermal/thermal_sys.c
> +++ b/drivers/thermal/thermal_sys.c
> @@ -41,17 +41,6 @@ MODULE_AUTHOR("Zhang Rui");
>  MODULE_DESCRIPTION("Generic thermal management sysfs support");
>  MODULE_LICENSE("GPL");
>
> -struct thermal_cooling_device_instance {
> -       int id;
> -       char name[THERMAL_NAME_LENGTH];
> -       struct thermal_zone_device *tz;
> -       struct thermal_cooling_device *cdev;
> -       int trip;
> -       char attr_name[THERMAL_NAME_LENGTH];
> -       struct device_attribute attr;
> -       struct list_head node;
> -};
> -
>  static DEFINE_IDR(thermal_tz_idr);
>  static DEFINE_IDR(thermal_cdev_idr);
>  static DEFINE_MUTEX(thermal_idr_lock);
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 4b94a61..3b05f37 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -119,6 +119,18 @@ struct thermal_zone_device {
>         struct list_head node;
>         struct delayed_work poll_queue;
>  };
> +
> +struct thermal_cooling_device_instance {
> +       int id;
> +       char name[THERMAL_NAME_LENGTH];
> +       struct thermal_zone_device *tz;
> +       struct thermal_cooling_device *cdev;
> +       int trip;
> +       char attr_name[THERMAL_NAME_LENGTH];
> +       struct device_attribute attr;
> +       struct list_head node;
> +};
> +
>  /* Adding event notification support elements */
>  #define THERMAL_GENL_FAMILY_NAME                "thermal_event"
>  #define THERMAL_GENL_VERSION                    0x01
> --
> 1.7.10
>
>

Patch

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 2ab31e4..0c5900f 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -41,17 +41,6 @@  MODULE_AUTHOR("Zhang Rui");
 MODULE_DESCRIPTION("Generic thermal management sysfs support");
 MODULE_LICENSE("GPL");
 
-struct thermal_cooling_device_instance {
-	int id;
-	char name[THERMAL_NAME_LENGTH];
-	struct thermal_zone_device *tz;
-	struct thermal_cooling_device *cdev;
-	int trip;
-	char attr_name[THERMAL_NAME_LENGTH];
-	struct device_attribute attr;
-	struct list_head node;
-};
-
 static DEFINE_IDR(thermal_tz_idr);
 static DEFINE_IDR(thermal_cdev_idr);
 static DEFINE_MUTEX(thermal_idr_lock);
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 4b94a61..3b05f37 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -119,6 +119,18 @@  struct thermal_zone_device {
 	struct list_head node;
 	struct delayed_work poll_queue;
 };
+
+struct thermal_cooling_device_instance {
+	int id;
+	char name[THERMAL_NAME_LENGTH];
+	struct thermal_zone_device *tz;
+	struct thermal_cooling_device *cdev;
+	int trip;
+	char attr_name[THERMAL_NAME_LENGTH];
+	struct device_attribute attr;
+	struct list_head node;
+};
+
 /* Adding event notification support elements */
 #define THERMAL_GENL_FAMILY_NAME                "thermal_event"
 #define THERMAL_GENL_VERSION                    0x01