diff options
Diffstat (limited to 'drivers/iio/common/hid-sensors/hid-sensor-attributes.c')
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c index 25b01e156d82..e81f434760f4 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c | |||
@@ -153,8 +153,8 @@ s32 hid_sensor_read_poll_value(struct hid_sensor_common *st) | |||
153 | int ret; | 153 | int ret; |
154 | 154 | ||
155 | ret = sensor_hub_get_feature(st->hsdev, | 155 | ret = sensor_hub_get_feature(st->hsdev, |
156 | st->poll.report_id, | 156 | st->poll.report_id, |
157 | st->poll.index, &value); | 157 | st->poll.index, sizeof(value), &value); |
158 | 158 | ||
159 | if (ret < 0 || value < 0) { | 159 | if (ret < 0 || value < 0) { |
160 | return -EINVAL; | 160 | return -EINVAL; |
@@ -174,8 +174,8 @@ int hid_sensor_read_samp_freq_value(struct hid_sensor_common *st, | |||
174 | int ret; | 174 | int ret; |
175 | 175 | ||
176 | ret = sensor_hub_get_feature(st->hsdev, | 176 | ret = sensor_hub_get_feature(st->hsdev, |
177 | st->poll.report_id, | 177 | st->poll.report_id, |
178 | st->poll.index, &value); | 178 | st->poll.index, sizeof(value), &value); |
179 | if (ret < 0 || value < 0) { | 179 | if (ret < 0 || value < 0) { |
180 | *val1 = *val2 = 0; | 180 | *val1 = *val2 = 0; |
181 | return -EINVAL; | 181 | return -EINVAL; |
@@ -212,9 +212,8 @@ int hid_sensor_write_samp_freq_value(struct hid_sensor_common *st, | |||
212 | else | 212 | else |
213 | value = 0; | 213 | value = 0; |
214 | } | 214 | } |
215 | ret = sensor_hub_set_feature(st->hsdev, | 215 | ret = sensor_hub_set_feature(st->hsdev, st->poll.report_id, |
216 | st->poll.report_id, | 216 | st->poll.index, sizeof(value), &value); |
217 | st->poll.index, value); | ||
218 | if (ret < 0 || value < 0) | 217 | if (ret < 0 || value < 0) |
219 | ret = -EINVAL; | 218 | ret = -EINVAL; |
220 | 219 | ||
@@ -229,8 +228,9 @@ int hid_sensor_read_raw_hyst_value(struct hid_sensor_common *st, | |||
229 | int ret; | 228 | int ret; |
230 | 229 | ||
231 | ret = sensor_hub_get_feature(st->hsdev, | 230 | ret = sensor_hub_get_feature(st->hsdev, |
232 | st->sensitivity.report_id, | 231 | st->sensitivity.report_id, |
233 | st->sensitivity.index, &value); | 232 | st->sensitivity.index, sizeof(value), |
233 | &value); | ||
234 | if (ret < 0 || value < 0) { | 234 | if (ret < 0 || value < 0) { |
235 | *val1 = *val2 = 0; | 235 | *val1 = *val2 = 0; |
236 | return -EINVAL; | 236 | return -EINVAL; |
@@ -253,9 +253,9 @@ int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st, | |||
253 | value = convert_to_vtf_format(st->sensitivity.size, | 253 | value = convert_to_vtf_format(st->sensitivity.size, |
254 | st->sensitivity.unit_expo, | 254 | st->sensitivity.unit_expo, |
255 | val1, val2); | 255 | val1, val2); |
256 | ret = sensor_hub_set_feature(st->hsdev, | 256 | ret = sensor_hub_set_feature(st->hsdev, st->sensitivity.report_id, |
257 | st->sensitivity.report_id, | 257 | st->sensitivity.index, sizeof(value), |
258 | st->sensitivity.index, value); | 258 | &value); |
259 | if (ret < 0 || value < 0) | 259 | if (ret < 0 || value < 0) |
260 | ret = -EINVAL; | 260 | ret = -EINVAL; |
261 | 261 | ||