powerpc/windfarm: const'ify and add "priv" field to controls & sensors
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 18 Apr 2012 22:16:47 +0000 (22:16 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 30 Apr 2012 05:37:19 +0000 (15:37 +1000)
const'ify the sensor ops and name and add a void* for use by
the control and sensor drivers to point back to their private
data, avoiding the need to create a wrapper data structure
per sensor or control instance.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
drivers/macintosh/windfarm.h

index 7a2482cc26a7a09af070916482c0bf51bee1747a..3ef192a1fca084d66dcefd6eda6deea5f108b232 100644 (file)
@@ -35,12 +35,12 @@ struct wf_control_ops {
 };
 
 struct wf_control {
-       struct list_head        link;
-       struct wf_control_ops   *ops;
-       char                    *name;
-       int                     type;
-       struct kref             ref;
-       struct device_attribute attr;
+       struct list_head                link;
+       const struct wf_control_ops     *ops;
+       const char                      *name;
+       int                             type;
+       struct kref                     ref;
+       struct device_attribute         attr;
 };
 
 #define WF_CONTROL_TYPE_GENERIC                0
@@ -85,11 +85,12 @@ struct wf_sensor_ops {
 };
 
 struct wf_sensor {
-       struct list_head        link;
-       struct wf_sensor_ops    *ops;
-       char                    *name;
-       struct kref             ref;
-       struct device_attribute attr;
+       struct list_head                link;
+       const struct wf_sensor_ops      *ops;
+       const char                      *name;
+       struct kref                     ref;
+       struct device_attribute         attr;
+       void                            *priv;
 };
 
 /* Same lifetime rules as controls */