diff options
Diffstat (limited to 'drivers/iio/orientation/hid-sensor-rotation.c')
-rw-r--r-- | drivers/iio/orientation/hid-sensor-rotation.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c index 51387bbc1ce1..dccf848e8b0f 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -145,10 +145,8 @@ static int dev_rot_proc_event(struct hid_sensor_hub_device *hsdev, struct iio_dev *indio_dev = platform_get_drvdata(priv); struct dev_rot_state *rot_state = iio_priv(indio_dev); - dev_dbg(&indio_dev->dev, "dev_rot_proc_event [%d]\n", - rot_state->common_attributes.data_ready); - - if (rot_state->common_attributes.data_ready) + dev_dbg(&indio_dev->dev, "dev_rot_proc_event\n"); + if (atomic_read(&rot_state->common_attributes.data_ready)) hid_sensor_push_data(indio_dev, (u8 *)rot_state->sampled_vals, sizeof(rot_state->sampled_vals)); @@ -272,7 +270,7 @@ static int hid_dev_rot_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to initialize trigger buffer\n"); return ret; } - rot_state->common_attributes.data_ready = false; + atomic_set(&rot_state->common_attributes.data_ready, 0); ret = hid_sensor_setup_trigger(indio_dev, name, &rot_state->common_attributes); if (ret) { |