aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-18 18:16:47 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-30 01:37:19 -0400
commite074d08e2b98db1b19328bb9395052b34366831d (patch)
tree113e1938321b9d98e1d8ea97fb2fbc34408d1177
parente326b30fda9a985a2e7fda6fb9212b86bf025c39 (diff)
powerpc/windfarm: const'ify and add "priv" field to controls & sensors
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>
-rw-r--r--drivers/macintosh/windfarm.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/macintosh/windfarm.h b/drivers/macintosh/windfarm.h
index 7a2482cc26a7..3ef192a1fca0 100644
--- a/drivers/macintosh/windfarm.h
+++ b/drivers/macintosh/windfarm.h
@@ -35,12 +35,12 @@ struct wf_control_ops {
35}; 35};
36 36
37struct wf_control { 37struct wf_control {
38 struct list_head link; 38 struct list_head link;
39 struct wf_control_ops *ops; 39 const struct wf_control_ops *ops;
40 char *name; 40 const char *name;
41 int type; 41 int type;
42 struct kref ref; 42 struct kref ref;
43 struct device_attribute attr; 43 struct device_attribute attr;
44}; 44};
45 45
46#define WF_CONTROL_TYPE_GENERIC 0 46#define WF_CONTROL_TYPE_GENERIC 0
@@ -85,11 +85,12 @@ struct wf_sensor_ops {
85}; 85};
86 86
87struct wf_sensor { 87struct wf_sensor {
88 struct list_head link; 88 struct list_head link;
89 struct wf_sensor_ops *ops; 89 const struct wf_sensor_ops *ops;
90 char *name; 90 const char *name;
91 struct kref ref; 91 struct kref ref;
92 struct device_attribute attr; 92 struct device_attribute attr;
93 void *priv;
93}; 94};
94 95
95/* Same lifetime rules as controls */ 96/* Same lifetime rules as controls */