V4L/DVB (11333): pvrusb2: Report def_val items in sysfs symbolically, consistent with cur_val
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
5b72d71525
commit
7bf56f94a1
|
@ -153,14 +153,16 @@ static ssize_t show_def(struct device *class_dev,
|
||||||
struct pvr2_sysfs_ctl_item *cip;
|
struct pvr2_sysfs_ctl_item *cip;
|
||||||
int val;
|
int val;
|
||||||
int ret;
|
int ret;
|
||||||
|
unsigned int cnt = 0;
|
||||||
cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def);
|
cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def);
|
||||||
ret = pvr2_ctrl_get_def(cip->cptr, &val);
|
ret = pvr2_ctrl_get_def(cip->cptr, &val);
|
||||||
pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %d, stat=%d",
|
if (ret < 0) return ret;
|
||||||
cip->chptr, cip->ctl_id, val, ret);
|
ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val,
|
||||||
if (ret < 0) {
|
buf, PAGE_SIZE - 1, &cnt);
|
||||||
return ret;
|
pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %.*s (%d)",
|
||||||
}
|
cip->chptr, cip->ctl_id, cnt, buf, val);
|
||||||
return scnprintf(buf, PAGE_SIZE, "%d\n", val);
|
buf[cnt] = '\n';
|
||||||
|
return cnt + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t show_val_norm(struct device *class_dev,
|
static ssize_t show_val_norm(struct device *class_dev,
|
||||||
|
|
Loading…
Reference in a new issue