iio: Drop timestamp parameter from buffer store_to callback
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 4 Sep 2012 12:38:00 +0000 (13:38 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 8 Sep 2012 09:14:34 +0000 (10:14 +0100)
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>
30 files changed:
drivers/iio/accel/hid-sensor-accel-3d.c
drivers/iio/adc/ad7266.c
drivers/iio/adc/ad_sigma_delta.c
drivers/iio/adc/at91_adc.c
drivers/iio/gyro/hid-sensor-gyro-3d.c
drivers/iio/industrialio-buffer.c
drivers/iio/kfifo_buf.c
drivers/iio/light/adjd_s311.c
drivers/iio/light/hid-sensor-als.c
drivers/iio/magnetometer/hid-sensor-magn-3d.c
drivers/staging/iio/accel/adis16201_ring.c
drivers/staging/iio/accel/adis16203_ring.c
drivers/staging/iio/accel/adis16204_ring.c
drivers/staging/iio/accel/adis16209_ring.c
drivers/staging/iio/accel/adis16240_ring.c
drivers/staging/iio/accel/lis3l02dq_ring.c
drivers/staging/iio/adc/ad7298_ring.c
drivers/staging/iio/adc/ad7476_ring.c
drivers/staging/iio/adc/ad7606_ring.c
drivers/staging/iio/adc/ad7887_ring.c
drivers/staging/iio/adc/ad799x_ring.c
drivers/staging/iio/adc/max1363_ring.c
drivers/staging/iio/adc/mxs-lradc.c
drivers/staging/iio/gyro/adis16260_ring.c
drivers/staging/iio/iio_simple_dummy_buffer.c
drivers/staging/iio/impedance-analyzer/ad5933.c
drivers/staging/iio/imu/adis16400_ring.c
drivers/staging/iio/meter/ade7758_ring.c
drivers/staging/iio/ring_sw.c
include/linux/iio/buffer.h

index c593eb239270cd5a88b5cafb2945ed67909b5825..314a4057879e6dc3e785a54f0baa1b7459d30f9e 100644 (file)
@@ -198,7 +198,6 @@ static const struct iio_info accel_3d_info = {
 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
 {
        struct iio_buffer *buffer = indio_dev->buffer;
-       s64 timestamp = iio_get_time_ns();
        int datum_sz;
 
        dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
@@ -212,7 +211,7 @@ static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
                                datum_sz);
                return;
        }
-       iio_push_to_buffer(buffer, (u8 *)data, timestamp);
+       iio_push_to_buffer(buffer, (u8 *)data);
 }
 
 /* Callback handler to send event after all samples are received and captured */
index 5c3f1ba5a06dcb362d28f0d3bcd3debe690b193c..b11f214779a2def29323c938c7dca736b99e087f 100644 (file)
@@ -99,7 +99,7 @@ static irqreturn_t ad7266_trigger_handler(int irq, void *p)
        if (ret == 0) {
                if (indio_dev->scan_timestamp)
                        ((s64 *)st->data)[1] = pf->timestamp;
-               iio_push_to_buffer(buffer, (u8 *)st->data, pf->timestamp);
+               iio_push_to_buffer(buffer, (u8 *)st->data);
        }
 
        iio_trigger_notify_done(indio_dev->trig);
index ae847c5a1361a97887d29d5ffd18740c2892bb29..67baa1363d7a026f5bdd48ed3fe4f72115ef5e7e 100644 (file)
@@ -391,7 +391,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
                break;
        }
 
-       iio_push_to_buffer(indio_dev->buffer, (uint8_t *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (uint8_t *)data);
 
        iio_trigger_notify_done(indio_dev->trig);
        sigma_delta->irq_dis = false;
index c1e4690f188d200830d3c4aa22350ba2e9e1885c..bc10091fe76c3ece3a156ec79972f224a3c1ab16 100644 (file)
@@ -82,7 +82,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
                *timestamp = pf->timestamp;
        }
 
-       buffer->access->store_to(buffer, (u8 *)st->buffer, pf->timestamp);
+       buffer->access->store_to(buffer, (u8 *)st->buffer);
 
        iio_trigger_notify_done(idev->trig);
        st->irq_enabled = true;
index 94a4740135e77c81c735040d7febcfce66da97b5..4c56ada51c3958343df1e56913a0b3ca56cf1be6 100644 (file)
@@ -198,7 +198,6 @@ static const struct iio_info gyro_3d_info = {
 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
 {
        struct iio_buffer *buffer = indio_dev->buffer;
-       s64 timestamp = iio_get_time_ns();
        int datum_sz;
 
        dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
@@ -212,7 +211,7 @@ static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
                                datum_sz);
                return;
        }
-       iio_push_to_buffer(buffer, (u8 *)data, timestamp);
+       iio_push_to_buffer(buffer, (u8 *)data);
 }
 
 /* Callback handler to send event after all samples are received and captured */
index 774891cf81393031cfcb87199622c807a98e6990..d4ad37455a678a15caf58dde7449ff82d323c510 100644 (file)
@@ -682,12 +682,11 @@ static unsigned char *iio_demux(struct iio_buffer *buffer,
        return buffer->demux_bounce;
 }
 
-int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data,
-                      s64 timestamp)
+int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data)
 {
        unsigned char *dataout = iio_demux(buffer, data);
 
-       return buffer->access->store_to(buffer, dataout, timestamp);
+       return buffer->access->store_to(buffer, dataout);
 }
 EXPORT_SYMBOL_GPL(iio_push_to_buffer);
 
index 63da42498a9a160d06f7245646985240e45862e3..5bc5c860e9ca5fe1426cf1189b3a581aad78f3ba 100644 (file)
@@ -95,8 +95,7 @@ static int iio_set_length_kfifo(struct iio_buffer *r, int length)
 }
 
 static int iio_store_to_kfifo(struct iio_buffer *r,
-                             u8 *data,
-                             s64 timestamp)
+                             u8 *data)
 {
        int ret;
        struct iio_kfifo *kf = iio_to_kfifo(r);
index 9a99f43094f0824dde61203647462a8872faab83..164b62b91a4bbded4ee56bb8db645ad9b75e0ba9 100644 (file)
@@ -187,7 +187,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
                        = time_ns;
-       iio_push_to_buffer(buffer, (u8 *)data->buffer, time_ns);
+       iio_push_to_buffer(buffer, (u8 *)data->buffer);
 
 done:
        iio_trigger_notify_done(indio_dev->trig);
index b3c8e91b2c8dac253a4810703907052b523522b0..96e3691e42c4970727f8240df40e8779aa9b0bd0 100644 (file)
@@ -177,7 +177,6 @@ static const struct iio_info als_info = {
 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
 {
        struct iio_buffer *buffer = indio_dev->buffer;
-       s64 timestamp = iio_get_time_ns();
        int datum_sz;
 
        dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
@@ -191,7 +190,7 @@ static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
                                datum_sz);
                return;
        }
-       iio_push_to_buffer(buffer, (u8 *)data, timestamp);
+       iio_push_to_buffer(buffer, (u8 *)data);
 }
 
 /* Callback handler to send event after all samples are received and captured */
index 397704eded97e5b729653aefed224feb828b78aa..c4f0d274f577471b15fe0d5e8d3f60b3c63292fe 100644 (file)
@@ -199,7 +199,6 @@ static const struct iio_info magn_3d_info = {
 static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
 {
        struct iio_buffer *buffer = indio_dev->buffer;
-       s64 timestamp = iio_get_time_ns();
        int datum_sz;
 
        dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
@@ -213,7 +212,7 @@ static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
                                datum_sz);
                return;
        }
-       iio_push_to_buffer(buffer, (u8 *)data, timestamp);
+       iio_push_to_buffer(buffer, (u8 *)data);
 }
 
 /* Callback handler to send event after all samples are received and captured */
index 884dcf89bce3b8a2e0849a62a3cf8f91d288df33..97c09f0c26aea3c4fb21b42cbe6413c0516deb06 100644 (file)
@@ -82,7 +82,7 @@ static irqreturn_t adis16201_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index a7ff80490c471575922f24d64e155f89d22c3724..7507e1a0459186f1b6e565704eecc8059821fde8 100644 (file)
@@ -81,7 +81,7 @@ static irqreturn_t adis16203_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index 16e36e3e9d33f44508283c017931a0d195908a40..4c976bec986b7beadb5faccfd8fcaed3be94a898 100644 (file)
@@ -78,7 +78,7 @@ static irqreturn_t adis16204_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index 5cfeff40fcf65a49cebe4a350f49d9c123dd2383..f939e29d6c82d515fa0157877d253a3fb6cf988a 100644 (file)
@@ -78,7 +78,7 @@ static irqreturn_t adis16209_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index d5ec43e877b580cf90693b6ac3f6b79ffed28ad3..caff8e25e0a2557cd181ed1995e3e53639c5c8ee 100644 (file)
@@ -76,7 +76,7 @@ static irqreturn_t adis16240_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index 9332762da7181a02aa13e625dfe81d88170834f8..247605ce50518f0152ebc3ca6e50e0e24be661fc 100644 (file)
@@ -152,7 +152,7 @@ static irqreturn_t lis3l02dq_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *(s64 *)((u8 *)data + ALIGN(len, sizeof(s64)))
                        = pf->timestamp;
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index 9fce4045cbb99125582587f3ee19b28d20da6681..c2906a85fedb355791a2dd0bb2dbae42275f2fd3 100644 (file)
@@ -93,7 +93,7 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p)
                                                 indio_dev->masklength); i++)
                buf[i] = be16_to_cpu(st->rx_buf[i]);
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)buf, time_ns);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)buf);
 
 done:
        iio_trigger_notify_done(indio_dev->trig);
index 3741ac6131dbef4b2a259c7c91cd9808b0a64686..940681f29b87b8c20e5379b7ad25f6820f58314b 100644 (file)
@@ -44,7 +44,7 @@ static irqreturn_t ad7476_trigger_handler(int irq, void  *p)
                memcpy(rxbuf + indio_dev->scan_bytes - sizeof(s64),
                        &time_ns, sizeof(time_ns));
 
-       iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns);
+       iio_push_to_buffer(indio_dev->buffer, rxbuf);
 done:
        iio_trigger_notify_done(indio_dev->trig);
        kfree(rxbuf);
index f4b009ee6635d415cd233af34fcfd1a24ee65769..ba04d0ffd4f49066aac2b04aa595ff88b16604ea 100644 (file)
@@ -83,7 +83,7 @@ static void ad7606_poll_bh_to_ring(struct work_struct *work_s)
        if (indio_dev->scan_timestamp)
                *((s64 *)(buf + indio_dev->scan_bytes - sizeof(s64))) = time_ns;
 
-       iio_push_to_buffer(indio_dev->buffer, buf, time_ns);
+       iio_push_to_buffer(indio_dev->buffer, buf);
 done:
        gpio_set_value(st->pdata->gpio_convst, 0);
        iio_trigger_notify_done(indio_dev->trig);
index a4ff4935982d3f7a074a0149696385fff0fbe2cb..b39923bbeedccf49e7364ed94b32c3ebbbdaf1ce 100644 (file)
@@ -95,7 +95,7 @@ static irqreturn_t ad7887_trigger_handler(int irq, void *p)
                memcpy(buf + indio_dev->scan_bytes - sizeof(s64),
                       &time_ns, sizeof(time_ns));
 
-       iio_push_to_buffer(indio_dev->buffer, buf, time_ns);
+       iio_push_to_buffer(indio_dev->buffer, buf);
 done:
        kfree(buf);
        iio_trigger_notify_done(indio_dev->trig);
index 84275c3c6b2636b553ca340bf1079ec398a445ab..86026d9b20bc604e5acb8643891d7ed34d62d44a 100644 (file)
@@ -77,7 +77,7 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p)
                memcpy(rxbuf + indio_dev->scan_bytes - sizeof(s64),
                        &time_ns, sizeof(time_ns));
 
-       iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns);
+       iio_push_to_buffer(indio_dev->buffer, rxbuf);
 done:
        kfree(rxbuf);
 out:
index 774ae1b6355060451d4114d8c2b59b36192de4dd..5f74f3b7671af40c21bc6c3e14ca463eb41881c0 100644 (file)
@@ -80,7 +80,7 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
 
        if (indio_dev->scan_timestamp)
                memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
-       iio_push_to_buffer(indio_dev->buffer, rxbuf, time_ns);
+       iio_push_to_buffer(indio_dev->buffer, rxbuf);
 
 done_free:
        kfree(rxbuf);
index ae549e572e5d8fa7dec1a85ab26a4151918fbed7..ca7c1fa88e717b4c809a5fa50d00ed9246e8cef2 100644 (file)
@@ -256,7 +256,7 @@ static irqreturn_t mxs_lradc_trigger_handler(int irq, void *p)
                *timestamp = pf->timestamp;
        }
 
-       iio_push_to_buffer(buffer, (u8 *)lradc->buffer, pf->timestamp);
+       iio_push_to_buffer(buffer, (u8 *)lradc->buffer);
 
        iio_trigger_notify_done(iio->trig);
 
index e6e23450382432da8f5d7a8f38da842a857dca51..e294cb49736d05947a6024f909fc4d4af197d2e0 100644 (file)
@@ -81,7 +81,7 @@ static irqreturn_t adis16260_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)data);
 
        kfree(data);
 done:
index e08021362ecf410ae92f018131bc0510fd7616c5..1fd38095b2ca55727530ab9359e36a05851a968b 100644 (file)
@@ -87,7 +87,7 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
        if (indio_dev->scan_timestamp)
                *(s64 *)((u8 *)data + ALIGN(len, sizeof(s64)))
                        = iio_get_time_ns();
-       iio_push_to_buffer(buffer, (u8 *)data, pf->timestamp);
+       iio_push_to_buffer(buffer, (u8 *)data);
 
        kfree(data);
 
index 39a9be8b7d8e5d0f25d2d35c58efebcdc8267778..de21d47f33e91386969171eb024086659005bd06 100644 (file)
@@ -678,7 +678,7 @@ static void ad5933_work(struct work_struct *work)
                        buf[0] = be16_to_cpu(buf[0]);
                }
                /* save datum to the ring */
-               iio_push_to_buffer(ring, (u8 *)buf, iio_get_time_ns());
+               iio_push_to_buffer(ring, (u8 *)buf);
        } else {
                /* no data available - try again later */
                schedule_delayed_work(&st->work, st->poll_time_jiffies);
index 6b717886b5b447e7f7e85ece2f5c3e1c9e80c399..260bdd1a468174e0f2572b8a5743b93d2519c56d 100644 (file)
@@ -150,7 +150,7 @@ static irqreturn_t adis16400_trigger_handler(int irq, void *p)
        /* Guaranteed to be aligned with 8 byte boundary */
        if (ring->scan_timestamp)
                *((s64 *)(data + ((i + 3)/4)*4)) = pf->timestamp;
-       iio_push_to_buffer(ring, (u8 *) data, pf->timestamp);
+       iio_push_to_buffer(ring, (u8 *) data);
 
 done:
        kfree(data);
index 23c107a09ceb0cf555caaecd218b705ec98a667e..9e49baccf660eb4d303859fc8166df6817b2326e 100644 (file)
@@ -73,7 +73,7 @@ static irqreturn_t ade7758_trigger_handler(int irq, void *p)
        if (indio_dev->scan_timestamp)
                dat64[1] = pf->timestamp;
 
-       iio_push_to_buffer(indio_dev->buffer, (u8 *)dat64, pf->timestamp);
+       iio_push_to_buffer(indio_dev->buffer, (u8 *)dat64);
 
        iio_trigger_notify_done(indio_dev->trig);
 
index f61c8fdaab065a93f183da64b0badd6811c8ffcf..3a45f9a52de803a1b0a434a899defc5b0b5767d9 100644 (file)
@@ -65,7 +65,7 @@ static inline void __iio_free_sw_ring_buffer(struct iio_sw_ring_buffer *ring)
 /* Lock always held if their is a chance this may be called */
 /* Only one of these per ring may run concurrently - enforced by drivers */
 static int iio_store_to_sw_ring(struct iio_sw_ring_buffer *ring,
-                               unsigned char *data, s64 timestamp)
+                               unsigned char *data)
 {
        int ret = 0;
        unsigned char *temp_ptr, *change_test_ptr;
@@ -256,11 +256,10 @@ error_ret:
 }
 
 static int iio_store_to_sw_rb(struct iio_buffer *r,
-                             u8 *data,
-                             s64 timestamp)
+                             u8 *data)
 {
        struct iio_sw_ring_buffer *ring = iio_to_sw_ring(r);
-       return iio_store_to_sw_ring(ring, data, timestamp);
+       return iio_store_to_sw_ring(ring, data);
 }
 
 static int iio_request_update_sw_rb(struct iio_buffer *r)
index 8ba516fc2ec6c8d1918879b238797edf4213cacb..c629b3a1d9a95a22d81e7d7ed293fef5a43612e3 100644 (file)
@@ -36,7 +36,7 @@ struct iio_buffer;
  * any of them not existing.
  **/
 struct iio_buffer_access_funcs {
-       int (*store_to)(struct iio_buffer *buffer, u8 *data, s64 timestamp);
+       int (*store_to)(struct iio_buffer *buffer, u8 *data);
        int (*read_first_n)(struct iio_buffer *buffer,
                            size_t n,
                            char __user *buf);
@@ -118,10 +118,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
  * iio_push_to_buffer() - push to a registered buffer.
  * @buffer:            IIO buffer structure for device
  * @data:              the data to push to the buffer
- * @timestamp:         timestamp to associate with the data
  */
-int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data,
-                      s64 timestamp);
+int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data);
 
 int iio_update_demux(struct iio_dev *indio_dev);