diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-sysfs.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index e20ba1e6e0ea..299c1cbc3832 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |||
@@ -153,14 +153,16 @@ static ssize_t show_def(struct device *class_dev, | |||
153 | struct pvr2_sysfs_ctl_item *cip; | 153 | struct pvr2_sysfs_ctl_item *cip; |
154 | int val; | 154 | int val; |
155 | int ret; | 155 | int ret; |
156 | unsigned int cnt = 0; | ||
156 | cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def); | 157 | cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def); |
157 | ret = pvr2_ctrl_get_def(cip->cptr, &val); | 158 | ret = pvr2_ctrl_get_def(cip->cptr, &val); |
158 | pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %d, stat=%d", | 159 | if (ret < 0) return ret; |
159 | cip->chptr, cip->ctl_id, val, ret); | 160 | ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val, |
160 | if (ret < 0) { | 161 | buf, PAGE_SIZE - 1, &cnt); |
161 | return ret; | 162 | pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %.*s (%d)", |
162 | } | 163 | cip->chptr, cip->ctl_id, cnt, buf, val); |
163 | return scnprintf(buf, PAGE_SIZE, "%d\n", val); | 164 | buf[cnt] = '\n'; |
165 | return cnt + 1; | ||
164 | } | 166 | } |
165 | 167 | ||
166 | static ssize_t show_val_norm(struct device *class_dev, | 168 | static ssize_t show_val_norm(struct device *class_dev, |