diff options
| author | Nikita Yushchenko <nikita.yoush@cogentembedded.com> | 2017-05-19 17:48:00 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-13 19:50:08 +0200 |
| commit | ce839ed8186ca60a95373df042f806a64284f2e7 (patch) | |
| tree | 07759c9f534afd6bdee0d69ba8d55795f69c7b2f /security/selinux/hooks.c | |
| parent | 1799ba22a8455deba44d5188513291ced8388e79 (diff) | |
iio: hi8435: avoid garbage event at first enable
[ Upstream commit ee19ac340c5fdfd89c6348be4563453c61ab54a9 ]
Currently, driver generates events for channels if new reading differs
from previous one. This "previous value" is initialized to zero, which
results into event if value is constant-one.
Fix that by initializing "previous value" by reading at event enable
time.
This provides reliable sequence for userspace:
- enable event,
- AFTER THAT read current value,
- AFTER THAT each event will correspond to change.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions
