diff options
author | Mike Isely <isely@pobox.com> | 2009-03-31 23:51:53 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2009-03-31 23:51:53 -0500 |
commit | 3082c825708d174b83fbcf67482d6e8acbb03d23 (patch) | |
tree | cddcf979a55bd50846578d1636df5ed93d201a56 /linux/drivers/media/video | |
parent | 103979f7c3e7b514b671dc8853ddd47f033c6add (diff) | |
download | mediapointer-dvb-s2-3082c825708d174b83fbcf67482d6e8acbb03d23.tar.gz mediapointer-dvb-s2-3082c825708d174b83fbcf67482d6e8acbb03d23.tar.bz2 |
pvrusb2: Report def_val items in sysfs symbolically, consistent with cur_val
From: Mike Isely <isely@pobox.com>
Priority: normal
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 84379d6e0..7ed3b8453 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -154,14 +154,16 @@ static ssize_t show_def(struct device *class_dev, struct pvr2_sysfs_ctl_item *cip; int val; int ret; + unsigned int cnt = 0; cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def); ret = pvr2_ctrl_get_def(cip->cptr, &val); - pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %d, stat=%d", - cip->chptr, cip->ctl_id, val, ret); - if (ret < 0) { - return ret; - } - return scnprintf(buf, PAGE_SIZE, "%d\n", val); + if (ret < 0) return ret; + ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val, + buf, PAGE_SIZE - 1, &cnt); + pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %.*s (%d)", + cip->chptr, cip->ctl_id, cnt, buf, val); + buf[cnt] = '\n'; + return cnt + 1; } static ssize_t show_val_norm(struct device *class_dev, |