Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: Drop timestamp parameter from buffer store_to callback

Drop timestamp parameter from buffer store_to callback and subsequently from
iio_push_to_buffer. The timestamp parameter is unused and it seems likely that
it will stay unused in the future, so it should be safe to remove it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Lars-Peter Clausen and committed by
Jonathan Cameron
ce56ade6 a0d7bf7d

+34 -43
+1 -2
drivers/iio/accel/hid-sensor-accel-3d.c
··· 198 198 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) 199 199 { 200 200 struct iio_buffer *buffer = indio_dev->buffer; 201 - s64 timestamp = iio_get_time_ns(); 202 201 int datum_sz; 203 202 204 203 dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); ··· 211 212 datum_sz); 212 213 return; 213 214 } 214 - iio_push_to_buffer(buffer, (u8 *)data, timestamp); 215 + iio_push_to_buffer(buffer, (u8 *)data); 215 216 } 216 217 217 218 /* Callback handler to send event after all samples are received and captured */
+1 -1
drivers/iio/adc/ad7266.c
··· 99 99 if (ret == 0) { 100 100 if (indio_dev->scan_timestamp) 101 101 ((s64 *)st->data)[1] = pf->timestamp; 102 - iio_push_to_buffer(buffer, (u8 *)st->data, pf->timestamp); 102 + iio_push_to_buffer(buffer, (u8 *)st->data); 103 103 } 104 104 105 105 iio_trigger_notify_done(indio_dev->trig);
+1 -1
drivers/iio/adc/ad_sigma_delta.c
··· 391 391 break; 392 392 } 393 393 394 - iio_push_to_buffer(indio_dev->buffer, (uint8_t *)data, pf->timestamp); 394 + iio_push_to_buffer(indio_dev->buffer, (uint8_t *)data); 395 395 396 396 iio_trigger_notify_done(indio_dev->trig); 397 397 sigma_delta->irq_dis = false;
+1 -1
drivers/iio/adc/at91_adc.c
··· 82 82 *timestamp = pf->timestamp; 83 83 } 84 84 85 - buffer->access->store_to(buffer, (u8 *)st->buffer, pf->timestamp); 85 + buffer->access->store_to(buffer, (u8 *)st->buffer); 86 86 87 87 iio_trigger_notify_done(idev->trig); 88 88 st->irq_enabled = true;
+1 -2
drivers/iio/gyro/hid-sensor-gyro-3d.c
··· 198 198 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) 199 199 { 200 200 struct iio_buffer *buffer = indio_dev->buffer; 201 - s64 timestamp = iio_get_time_ns(); 202 201 int datum_sz; 203 202 204 203 dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); ··· 211 212 datum_sz); 212 213 return; 213 214 } 214 - iio_push_to_buffer(buffer, (u8 *)data, timestamp); 215 + iio_push_to_buffer(buffer, (u8 *)data); 215 216 } 216 217 217 218 /* Callback handler to send event after all samples are received and captured */
+2 -3
drivers/iio/industrialio-buffer.c
··· 682 682 return buffer->demux_bounce; 683 683 } 684 684 685 - int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data, 686 - s64 timestamp) 685 + int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data) 687 686 { 688 687 unsigned char *dataout = iio_demux(buffer, data); 689 688 690 - return buffer->access->store_to(buffer, dataout, timestamp); 689 + return buffer->access->store_to(buffer, dataout); 691 690 } 692 691 EXPORT_SYMBOL_GPL(iio_push_to_buffer); 693 692
+1 -2
drivers/iio/kfifo_buf.c
··· 95 95 } 96 96 97 97 static int iio_store_to_kfifo(struct iio_buffer *r, 98 - u8 *data, 99 - s64 timestamp) 98 + u8 *data) 100 99 { 101 100 int ret; 102 101 struct iio_kfifo *kf = iio_to_kfifo(r);
+1 -1
drivers/iio/light/adjd_s311.c
··· 187 187 if (indio_dev->scan_timestamp) 188 188 *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64))) 189 189 = time_ns; 190 - iio_push_to_buffer(buffer, (u8 *)data->buffer, time_ns); 190 + iio_push_to_buffer(buffer, (u8 *)data->buffer); 191 191 192 192 done: 193 193 iio_trigger_notify_done(indio_dev->trig);
+1 -2
drivers/iio/light/hid-sensor-als.c
··· 177 177 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) 178 178 { 179 179 struct iio_buffer *buffer = indio_dev->buffer; 180 - s64 timestamp = iio_get_time_ns(); 181 180 int datum_sz; 182 181 183 182 dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); ··· 190 191 datum_sz); 191 192 return; 192 193 } 193 - iio_push_to_buffer(buffer, (u8 *)data, timestamp); 194 + iio_push_to_buffer(buffer, (u8 *)data); 194 195 } 195 196 196 197 /* Callback handler to send event after all samples are received and captured */
+1 -2
drivers/iio/magnetometer/hid-sensor-magn-3d.c
··· 199 199 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) 200 200 { 201 201 struct iio_buffer *buffer = indio_dev->buffer; 202 - s64 timestamp = iio_get_time_ns(); 203 202 int datum_sz; 204 203 205 204 dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); ··· 212 213 datum_sz); 213 214 return; 214 215 } 215 - iio_push_to_buffer(buffer, (u8 *)data, timestamp); 216 + iio_push_to_buffer(buffer, (u8 *)data); 216 217 } 217 218 218 219 /* Callback handler to send event after all samples are received and captured */
+1 -1
drivers/staging/iio/accel/adis16201_ring.c
··· 82 82 if (indio_dev->scan_timestamp) 83 83 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 84 84 85 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 85 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 86 86 87 87 kfree(data); 88 88 done:
+1 -1
drivers/staging/iio/accel/adis16203_ring.c
··· 81 81 if (indio_dev->scan_timestamp) 82 82 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 83 83 84 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 84 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 85 85 86 86 kfree(data); 87 87 done:
+1 -1
drivers/staging/iio/accel/adis16204_ring.c
··· 78 78 if (indio_dev->scan_timestamp) 79 79 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 80 80 81 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 81 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 82 82 83 83 kfree(data); 84 84 done:
+1 -1
drivers/staging/iio/accel/adis16209_ring.c
··· 78 78 if (indio_dev->scan_timestamp) 79 79 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 80 80 81 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 81 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 82 82 83 83 kfree(data); 84 84 done:
+1 -1
drivers/staging/iio/accel/adis16240_ring.c
··· 76 76 if (indio_dev->scan_timestamp) 77 77 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 78 78 79 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 79 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 80 80 81 81 kfree(data); 82 82 done:
+1 -1
drivers/staging/iio/accel/lis3l02dq_ring.c
··· 152 152 if (indio_dev->scan_timestamp) 153 153 *(s64 *)((u8 *)data + ALIGN(len, sizeof(s64))) 154 154 = pf->timestamp; 155 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 155 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 156 156 157 157 kfree(data); 158 158 done:
+1 -1
drivers/staging/iio/adc/ad7298_ring.c
··· 93 93 indio_dev->masklength); i++) 94 94 buf[i] = be16_to_cpu(st->rx_buf[i]); 95 95 96 - iio_push_to_buffer(indio_dev->buffer, (u8 *)buf, time_ns); 96 + iio_push_to_buffer(indio_dev->buffer, (u8 *)buf); 97 97 98 98 done: 99 99 iio_trigger_notify_done(indio_dev->trig);
+1 -1
drivers/staging/iio/adc/ad7476_ring.c
··· 44 44 memcpy(rxbuf + indio_dev->scan_bytes - sizeof(s64), 45 45 &time_ns, sizeof(time_ns)); 46 46 47 - iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns); 47 + iio_push_to_buffer(indio_dev->buffer, rxbuf); 48 48 done: 49 49 iio_trigger_notify_done(indio_dev->trig); 50 50 kfree(rxbuf);
+1 -1
drivers/staging/iio/adc/ad7606_ring.c
··· 83 83 if (indio_dev->scan_timestamp) 84 84 *((s64 *)(buf + indio_dev->scan_bytes - sizeof(s64))) = time_ns; 85 85 86 - iio_push_to_buffer(indio_dev->buffer, buf, time_ns); 86 + iio_push_to_buffer(indio_dev->buffer, buf); 87 87 done: 88 88 gpio_set_value(st->pdata->gpio_convst, 0); 89 89 iio_trigger_notify_done(indio_dev->trig);
+1 -1
drivers/staging/iio/adc/ad7887_ring.c
··· 95 95 memcpy(buf + indio_dev->scan_bytes - sizeof(s64), 96 96 &time_ns, sizeof(time_ns)); 97 97 98 - iio_push_to_buffer(indio_dev->buffer, buf, time_ns); 98 + iio_push_to_buffer(indio_dev->buffer, buf); 99 99 done: 100 100 kfree(buf); 101 101 iio_trigger_notify_done(indio_dev->trig);
+1 -1
drivers/staging/iio/adc/ad799x_ring.c
··· 77 77 memcpy(rxbuf + indio_dev->scan_bytes - sizeof(s64), 78 78 &time_ns, sizeof(time_ns)); 79 79 80 - iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns); 80 + iio_push_to_buffer(indio_dev->buffer, rxbuf); 81 81 done: 82 82 kfree(rxbuf); 83 83 out:
+1 -1
drivers/staging/iio/adc/max1363_ring.c
··· 80 80 81 81 if (indio_dev->scan_timestamp) 82 82 memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns)); 83 - iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns); 83 + iio_push_to_buffer(indio_dev->buffer, rxbuf); 84 84 85 85 done_free: 86 86 kfree(rxbuf);
+1 -1
drivers/staging/iio/adc/mxs-lradc.c
··· 256 256 *timestamp = pf->timestamp; 257 257 } 258 258 259 - iio_push_to_buffer(buffer, (u8 *)lradc->buffer, pf->timestamp); 259 + iio_push_to_buffer(buffer, (u8 *)lradc->buffer); 260 260 261 261 iio_trigger_notify_done(iio->trig); 262 262
+1 -1
drivers/staging/iio/gyro/adis16260_ring.c
··· 81 81 if (indio_dev->scan_timestamp) 82 82 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 83 83 84 - iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp); 84 + iio_push_to_buffer(indio_dev->buffer, (u8 *)data); 85 85 86 86 kfree(data); 87 87 done:
+1 -1
drivers/staging/iio/iio_simple_dummy_buffer.c
··· 87 87 if (indio_dev->scan_timestamp) 88 88 *(s64 *)((u8 *)data + ALIGN(len, sizeof(s64))) 89 89 = iio_get_time_ns(); 90 - iio_push_to_buffer(buffer, (u8 *)data, pf->timestamp); 90 + iio_push_to_buffer(buffer, (u8 *)data); 91 91 92 92 kfree(data); 93 93
+1 -1
drivers/staging/iio/impedance-analyzer/ad5933.c
··· 678 678 buf[0] = be16_to_cpu(buf[0]); 679 679 } 680 680 /* save datum to the ring */ 681 - iio_push_to_buffer(ring, (u8 *)buf, iio_get_time_ns()); 681 + iio_push_to_buffer(ring, (u8 *)buf); 682 682 } else { 683 683 /* no data available - try again later */ 684 684 schedule_delayed_work(&st->work, st->poll_time_jiffies);
+1 -1
drivers/staging/iio/imu/adis16400_ring.c
··· 150 150 /* Guaranteed to be aligned with 8 byte boundary */ 151 151 if (ring->scan_timestamp) 152 152 *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp; 153 - iio_push_to_buffer(ring, (u8 *) data, pf->timestamp); 153 + iio_push_to_buffer(ring, (u8 *) data); 154 154 155 155 done: 156 156 kfree(data);
+1 -1
drivers/staging/iio/meter/ade7758_ring.c
··· 73 73 if (indio_dev->scan_timestamp) 74 74 dat64[1] = pf->timestamp; 75 75 76 - iio_push_to_buffer(indio_dev->buffer, (u8 *)dat64, pf->timestamp); 76 + iio_push_to_buffer(indio_dev->buffer, (u8 *)dat64); 77 77 78 78 iio_trigger_notify_done(indio_dev->trig); 79 79
+3 -4
drivers/staging/iio/ring_sw.c
··· 65 65 /* Lock always held if their is a chance this may be called */ 66 66 /* Only one of these per ring may run concurrently - enforced by drivers */ 67 67 static int iio_store_to_sw_ring(struct iio_sw_ring_buffer *ring, 68 - unsigned char *data, s64 timestamp) 68 + unsigned char *data) 69 69 { 70 70 int ret = 0; 71 71 unsigned char *temp_ptr, *change_test_ptr; ··· 256 256 } 257 257 258 258 static int iio_store_to_sw_rb(struct iio_buffer *r, 259 - u8 *data, 260 - s64 timestamp) 259 + u8 *data) 261 260 { 262 261 struct iio_sw_ring_buffer *ring = iio_to_sw_ring(r); 263 - return iio_store_to_sw_ring(ring, data, timestamp); 262 + return iio_store_to_sw_ring(ring, data); 264 263 } 265 264 266 265 static int iio_request_update_sw_rb(struct iio_buffer *r)
+2 -4
include/linux/iio/buffer.h
··· 36 36 * any of them not existing. 37 37 **/ 38 38 struct iio_buffer_access_funcs { 39 - int (*store_to)(struct iio_buffer *buffer, u8 *data, s64 timestamp); 39 + int (*store_to)(struct iio_buffer *buffer, u8 *data); 40 40 int (*read_first_n)(struct iio_buffer *buffer, 41 41 size_t n, 42 42 char __user *buf); ··· 118 118 * iio_push_to_buffer() - push to a registered buffer. 119 119 * @buffer: IIO buffer structure for device 120 120 * @data: the data to push to the buffer 121 - * @timestamp: timestamp to associate with the data 122 121 */ 123 - int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data, 124 - s64 timestamp); 122 + int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); 125 123 126 124 int iio_update_demux(struct iio_dev *indio_dev); 127 125