summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-04-05 08:35:33 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-05 08:35:33 -0300
commitb6e32e956f7146fd7c85f3b7d83219c0c81f150d (patch)
tree8826d5dfb9a46f966dd7a7a4e2ebc914c40ba8a7 /linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
parent7e791201816fa3750dd804aab89a4ff0b93634a0 (diff)
parent4ebd0d44965effc239d92927a43fcfc37e786d87 (diff)
downloadmediapointer-dvb-s2-b6e32e956f7146fd7c85f3b7d83219c0c81f150d.tar.gz
mediapointer-dvb-s2-b6e32e956f7146fd7c85f3b7d83219c0c81f150d.tar.bz2
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c14
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,