summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-11-01 07:46:28 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-11-03 20:33:43 +0000
commit9b20c3fe68bd82e0eb7d74a5ab968553b90596aa (patch)
tree5af29e993bb0b2ae28a0a41a7ad061146bab2afb /drivers/iio
parent6e6738398def256126185cd25e2e3cb68f1bc0a3 (diff)
downloadlinux-stable-9b20c3fe68bd82e0eb7d74a5ab968553b90596aa.tar.gz
linux-stable-9b20c3fe68bd82e0eb7d74a5ab968553b90596aa.tar.bz2
linux-stable-9b20c3fe68bd82e0eb7d74a5ab968553b90596aa.zip
iio: hid-sensors-prox: Factor-in hid_sensor_push_data
The function is only called from one place and it is a one-liner. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Link: https://patch.msgid.link/20241101-hpd-v3-2-e9c80b7c7164@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/hid-sensor-prox.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
index 8fe50f897169..beccc727e1c4 100644
--- a/drivers/iio/light/hid-sensor-prox.c
+++ b/drivers/iio/light/hid-sensor-prox.c
@@ -153,14 +153,6 @@ static const struct iio_info prox_info = {
.write_raw = &prox_write_raw,
};
-/* Function to push data to buffer */
-static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
- int len)
-{
- dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
- iio_push_to_buffers(indio_dev, data);
-}
-
/* Callback handler to send event after all samples are received and captured */
static int prox_proc_event(struct hid_sensor_hub_device *hsdev,
unsigned usage_id,
@@ -170,10 +162,10 @@ static int prox_proc_event(struct hid_sensor_hub_device *hsdev,
struct prox_state *prox_state = iio_priv(indio_dev);
dev_dbg(&indio_dev->dev, "prox_proc_event\n");
- if (atomic_read(&prox_state->common_attributes.data_ready))
- hid_sensor_push_data(indio_dev,
- &prox_state->human_presence,
- sizeof(prox_state->human_presence));
+ if (atomic_read(&prox_state->common_attributes.data_ready)) {
+ dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
+ iio_push_to_buffers(indio_dev, &prox_state->human_presence);
+ }
return 0;
}