diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-04-19 00:16:51 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-04-30 07:37:20 +0200 |
commit | 33e6820b767a5bfa4a0d579da6ee4568a2b1e730 (patch) | |
tree | 341a29222e9fb18fe4ce6f9c9346bbc4190584e3 /drivers/macintosh/windfarm.h | |
parent | powerpc/windfarm: Improve display of fan speeds in sysfs (diff) | |
download | linux-33e6820b767a5bfa4a0d579da6ee4568a2b1e730.tar.xz linux-33e6820b767a5bfa4a0d579da6ee4568a2b1e730.zip |
powerpc/windfarm: Add useful accessors
Makes the code more readable
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/macintosh/windfarm.h')
-rw-r--r-- | drivers/macintosh/windfarm.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/macintosh/windfarm.h b/drivers/macintosh/windfarm.h index 3ef192a1fca0..a9e385ee359e 100644 --- a/drivers/macintosh/windfarm.h +++ b/drivers/macintosh/windfarm.h @@ -72,6 +72,26 @@ static inline int wf_control_set_min(struct wf_control *ct) return ct->ops->set_value(ct, vmin); } +static inline int wf_control_set(struct wf_control *ct, s32 val) +{ + return ct->ops->set_value(ct, val); +} + +static inline int wf_control_get(struct wf_control *ct, s32 *val) +{ + return ct->ops->get_value(ct, val); +} + +static inline s32 wf_control_get_min(struct wf_control *ct) +{ + return ct->ops->get_min(ct); +} + +static inline s32 wf_control_get_max(struct wf_control *ct) +{ + return ct->ops->get_max(ct); +} + /* * Sensor objects */ @@ -100,6 +120,11 @@ extern struct wf_sensor * wf_find_sensor(const char *name); extern int wf_get_sensor(struct wf_sensor *sr); extern void wf_put_sensor(struct wf_sensor *sr); +static inline int wf_sensor_get(struct wf_sensor *sr, s32 *val) +{ + return sr->ops->get_value(sr, val); +} + /* For use by clients. Note that we are a bit racy here since * notifier_block doesn't have a module owner field. I may fix * it one day ... |