Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305351
b: refs/heads/master
c: ea5c64b
h: refs/heads/master
i:
  305349: a1d67d5
  305347: eb5c25e
  305343: 9ae7c62
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Apr 30, 2012
1 parent 1fbaa9a commit 351eaa3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a94d72b13642364e4d9da6e9165da05c0e055507
refs/heads/master: ea5c64b06743b505e0eb4e6caa1810fe685c9559
13 changes: 12 additions & 1 deletion trunk/drivers/macintosh/windfarm_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,24 @@ static ssize_t wf_show_control(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wf_control *ctrl = container_of(attr, struct wf_control, attr);
const char *typestr;
s32 val = 0;
int err;

err = ctrl->ops->get_value(ctrl, &val);
if (err < 0)
return err;
return sprintf(buf, "%d\n", val);
switch(ctrl->type) {
case WF_CONTROL_RPM_FAN:
typestr = " RPM";
break;
case WF_CONTROL_PWM_FAN:
typestr = " %";
break;
default:
typestr = "";
}
return sprintf(buf, "%d%s\n", val, typestr);
}

/* This is really only for debugging... */
Expand Down

0 comments on commit 351eaa3

Please sign in to comment.