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

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>

authored by

Ricardo Ribalda and committed by
Jonathan Cameron
9b20c3fe 6e673839

+4 -12
+4 -12
drivers/iio/light/hid-sensor-prox.c
··· 153 153 .write_raw = &prox_write_raw, 154 154 }; 155 155 156 - /* Function to push data to buffer */ 157 - static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data, 158 - int len) 159 - { 160 - dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); 161 - iio_push_to_buffers(indio_dev, data); 162 - } 163 - 164 156 /* Callback handler to send event after all samples are received and captured */ 165 157 static int prox_proc_event(struct hid_sensor_hub_device *hsdev, 166 158 unsigned usage_id, ··· 162 170 struct prox_state *prox_state = iio_priv(indio_dev); 163 171 164 172 dev_dbg(&indio_dev->dev, "prox_proc_event\n"); 165 - if (atomic_read(&prox_state->common_attributes.data_ready)) 166 - hid_sensor_push_data(indio_dev, 167 - &prox_state->human_presence, 168 - sizeof(prox_state->human_presence)); 173 + if (atomic_read(&prox_state->common_attributes.data_ready)) { 174 + dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); 175 + iio_push_to_buffers(indio_dev, &prox_state->human_presence); 176 + } 169 177 170 178 return 0; 171 179 }